diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-08-17 14:27:54 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-08-17 14:27:54 -0700 |
commit | a0e2fa00f1005bf7d5853c83ff0f567663352e92 (patch) | |
tree | 9a000cf4db2e32d0217e6a845e086ae8d726a4aa /ipa-python | |
parent | 48bb474e6848f02de2b77a7abf6aed13857267ee (diff) | |
download | freeipa-a0e2fa00f1005bf7d5853c83ff0f567663352e92.tar.gz freeipa-a0e2fa00f1005bf7d5853c83ff0f567663352e92.tar.xz freeipa-a0e2fa00f1005bf7d5853c83ff0f567663352e92.zip |
Manual merge changes in for the cidict/ipaclient add_user()
Diffstat (limited to 'ipa-python')
-rw-r--r-- | ipa-python/ipaclient.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py index 28e560018..2d4e727ae 100644 --- a/ipa-python/ipaclient.py +++ b/ipa-python/ipaclient.py @@ -29,6 +29,14 @@ import user import ipa import config +def cidict_to_dict(cid): + """Convert a cidict to a standard dict for sending across the wire""" + newdict = {} + kindex = cid.keys() + for dkey in kindex: + newdict[dkey] = cid[dkey] + return newdict + class IPAClient: def __init__(self,local=None): @@ -53,7 +61,7 @@ class IPAClient: return user.User(result) def add_user(self,user): - """Add a user. user is a dict of attribute/value pairs""" + """Add a user. user is a cidict() of attribute/value pairs""" realm = config.config.get_realm() @@ -74,7 +82,9 @@ class IPAClient: if user.get('gn'): del user['gn'] - result = self.transport.add_user(user) + # convert to a regular dict before sending + dict_user = cidict_to_dict(user) + result = self.transport.add_user(dict_user) return result def get_all_users(self): |