Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#17 modlist value replacement

closed
None
5
2012-06-02
2012-05-31
Anonymous
No

Did not like how modifyModlist handled the case where there were old and new multi valued attribute differences. Delete all and then just add all the values from old? works, but when you have a million values and you only need to change a few, it's a bit of extra work.
Attached is my version of modlist.py that only deletes or adds what is different. Used the 2.4.9 version as the base I modified.
Done some testing, but it's not extensively tested.

Discussion

  •  
    Attachments
  • There is a good reason why the *generally* usable function modifyModlist() deletes all old values: Deleting distinct values only works if the LDAP server has an equality matching rule for an attribute. So your code won't work for jpegPhoto etc.

    If you have million of values you have to write custom code for such cases anyway. Most notable large group entries should obviously not modified by modlist values returned by function modifyModlist().

    web2ldap contains a much smarter variant which makes use of the LDAP server's schema. But the simple module ldap.modlist does not have any schema support (as most LDAP applications using python-ldap). Still this does not scale very well with really large group entries. Because of this web2ldap implements a specific use-case for maintaining large group entries.

    => closing this ticket

    Discussions about that should be taken to the python-ldap mailing list.

     
    • assigned_to: nobody --> stroeder
     
    • status: open --> closed