Manual merge changes in for the cidict/ipaclient add_user()

This commit is contained in:
Kevin McCarthy
2007-08-17 14:27:54 -07:00
parent 48bb474e68
commit a0e2fa00f1
4 changed files with 33 additions and 5 deletions

View File

@@ -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):