[Freeipa-devel] [PATCH] update user

Kevin McCarthy kmccarth at redhat.com
Thu Aug 16 21:37:26 UTC 2007


Rob Crittenden wrote:
> Initial patch to update an existing user entry. One thing you cannot do is 
> remove a field and expect to see it go away. I wasn't sure what we wanted 
> to do so I erred on the side of caution (it is fixable by switching 1 to 0 
> in the mod_s() call in ipaldap.py.
>
> This also ensures that Apache is using the forked model so the LDAP 
> connection pools don't blow up.
>
> And finally tweak user.py a little bit to try to ensure that blank values 
> can't get into an entry and that blank values don't cause it to blow up.
>
> I also added a helper function to user.py to convert a user entry into a 
> dict. I needed this for updates since python-ldap provides a function that 
> compares 2 dicts and returns the list of updates.

Looks good.

Rob, now that I've tested the xmlrpc layer isn't changing the
attributes, I think getValue() needs to be changed to:
-        if (len(value) < 1):
-            return value
-        if isinstance(value[0],list) or isinstance(value[0],tuple):
+        if isinstance(value,list) or isinstance(value,tuple):
            return value[0]
        else:
            return value

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070816/1fbb2c4d/attachment.bin>


More information about the Freeipa-devel mailing list