[python-ldap] Question about ldap.modlist.modifyModlist

Bas van der Vlies bas.vandervlies at surfsara.nl
Wed Jan 23 10:33:40 CET 2013


Hello,,

 I have question about the usage of ldap.modlist.modifyModlist.  I am using it a lot to replace values.   When i look at the generated ldif it deletes the attribute and then add the attribute:
 {{{
    (ldap.MOD_DELETE, "gidNumber", None),
    (ldap.MOD_ADD, "gidNumber", gid_new),
 }}}

This fine for most replacements. Bit for this case i only want to replace the value if  it matches the old one, e.g.:
{{{
      (ldap.MOD_DELETE, "gidNumber", gid_old),
      (ldap.MOD_ADD, "gidNumber", gid_new),
}}}

Is there an option for modifyModlist that supports this or must i just use the modify_s function?


regards


Bas van der Vlies           
mail:  bas at surfsara.nl     
SURFsara, www.surfsara.nl
Amsterdam, The Netherlands





More information about the python-ldap mailing list