summaryrefslogtreecommitdiffstats
path: root/ipa-python/ipaclient.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2007-11-26 19:30:33 -0500
committerJohn Dennis <jdennis@redhat.com>2007-11-26 19:30:33 -0500
commit09238510ff0dced7998e6a1b72f450070e8c6116 (patch)
tree990ecb78d559c97a86e25e816d58ce7e295619f5 /ipa-python/ipaclient.py
parent4f33d674188268432b3d8ef0921be0de3e6c5ef7 (diff)
downloadfreeipa-09238510ff0dced7998e6a1b72f450070e8c6116.tar.gz
freeipa-09238510ff0dced7998e6a1b72f450070e8c6116.tar.xz
freeipa-09238510ff0dced7998e6a1b72f450070e8c6116.zip
add command line utilites for radius profiles
Diffstat (limited to 'ipa-python/ipaclient.py')
-rw-r--r--ipa-python/ipaclient.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py
index fab337752..7a140308a 100644
--- a/ipa-python/ipaclient.py
+++ b/ipa-python/ipaclient.py
@@ -338,7 +338,7 @@ class IPAClient:
result = self.transport.get_radius_client_by_ip_addr(ip_addr, container, sattrs)
return radius_util.RadiusClient(result)
- def add_radius_client(self,client, container=None):
+ def add_radius_client(self, client, container=None):
client_dict = client.toDict()
# dn is set on the server-side
@@ -348,7 +348,7 @@ class IPAClient:
result = self.transport.add_radius_client(client_dict, container)
return result
- def update_radius_client(self,client):
+ def update_radius_client(self, client):
result = self.transport.update_radius_client(client.origDataDict(), client.toDict())
return result
@@ -366,3 +366,35 @@ class IPAClient:
return users
+ def get_radius_profile_by_uid(self, uid, user_profile=None, sattrs=None):
+ result = self.transport.get_radius_profile_by_uid(uid, user_profile, sattrs)
+ return radius_util.RadiusClient(result)
+
+ def add_radius_profile(self, profile, user_profile=None):
+ profile_dict = profile.toDict()
+
+ # dn is set on the server-side
+ del profile_dict['dn']
+
+ # convert to a regular dict before sending
+ result = self.transport.add_radius_profile(profile_dict, user_profile)
+ return result
+
+ def update_radius_profile(self, profile):
+ result = self.transport.update_radius_profile(profile.origDataDict(), profile.toDict())
+ return result
+
+ def delete_radius_profile(self, ip_addr, user_profile=None):
+ return self.transport.delete_radius_profile(ip_addr, user_profile)
+
+ def find_radius_profiles(self, criteria, user_profile=None, sattrs=None, searchlimit=0, timelimit=-1):
+ result = self.transport.find_radius_profiles(criteria, user_profile, sattrs, searchlimit, timelimit)
+ counter = result[0]
+
+ users = [counter]
+ for attrs in result[1:]:
+ if attrs is not None:
+ users.append(user.User(attrs))
+
+ return users
+