[Freeipa-devel] [PATCH] update user

Rob Crittenden rcritten at redhat.com
Fri Aug 17 13:51:12 UTC 2007


Kevin McCarthy wrote:
> 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

Looks good.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070817/ced54979/attachment.bin>


More information about the Freeipa-devel mailing list