From a0e2fa00f1005bf7d5853c83ff0f567663352e92 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 17 Aug 2007 14:27:54 -0700 Subject: Manual merge changes in for the cidict/ipaclient add_user() --- ipa-python/ipaclient.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ipa-python') 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): -- cgit