What's the best way to replace value of attribute which can handle multiple values?

Michael Ströder michael at stroeder.com
Wed Sep 9 15:48:32 CEST 2009


Zhang Huangbin wrote:
> 
> On Sep 9, 2009, at 9:32 PM, Michael Ströder wrote:
> 
>> Zhang Huangbin wrote:
>>> NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such
>>> value', 'desc': 'No such attribute'}
>>
>> This means the attribute 'enabledService' is not available in the
>> entry at
>> all. So you can't remove a certain attribute value from it.
>>
> Attribute is present, but not contains value 'forwrad'.

Then it will simply fail. If you have to handle such optional cases you
probably have to sort that out at the client side in some way. I'd read the
whole attribute value list, tweak it and replace it. BTW: That's why
ldap.modlist.modifyModlist() was implemented.

Ciao, Michael.



More information about the python-ldap mailing list