diff options
Diffstat (limited to 'ipa-python/ipaclient.py')
-rw-r--r-- | ipa-python/ipaclient.py | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py index 71def70f..fcfb29f1 100644 --- a/ipa-python/ipaclient.py +++ b/ipa-python/ipaclient.py @@ -94,12 +94,14 @@ class IPAClient: return result def find_users(self, criteria, sattrs=None): - """Find users whose uid matches the criteria. Wildcards are - acceptable. Returns a list of User objects.""" + """Return a list: counter followed by a User object for each user that + matches the criteria. If the results are truncated, counter will + be set to -1""" result = self.transport.find_users(criteria, sattrs) + counter = result[0] - users = [] - for attrs in result: + users = [counter] + for attrs in result[1:]: if attrs is not None: users.append(user.User(attrs)) @@ -113,6 +115,14 @@ class IPAClient: result = self.transport.update_user(user.origDataDict(), user.toDict()) return result + def delete_user(self,uid): + """Delete a user entry.""" + + realm = config.config.get_realm() + + result = self.transport.delete_user(uid) + return result + def mark_user_deleted(self,uid): """Set a user as inactive by uid.""" @@ -202,7 +212,17 @@ class IPAClient: def update_group(self,group): """Update a group entry.""" - realm = config.config.get_realm() + return self.transport.update_group(group.origDataDict(), group.toDict()) - result = self.transport.update_group(group.origDataDict(), group.toDict()) - return result + def delete_group(self,group_cn): + """Delete a group entry.""" + + return self.transport.delete_group(group_cn) + + def add_group_to_group(self, group_cn, tgroup_cn): + """Add a group to an existing group. + group_cn is a cn of the group to add + tgroup_cn is the cn of the group to be added to + """ + + return self.transport.add_group_to_group(group_cn, tgroup_cn) |