tldap.modlist

This module contains a modifyModlist function adopted from ldap.modlist.

tldap.modlist.addModlist(entry, ignore_attr_types=None)[source]

Build modify list for call of method LDAPObject.add()

tldap.modlist.list_dict(l, case_insensitive=0)[source]

return a dictionary with all items of l being the keys of the dictionary

If argument case_insensitive is non-zero ldap.cidict.cidict will be used for case-insensitive string keys

tldap.modlist.modifyModlist(old_entry, new_entry, ignore_attr_types=None, ignore_oldexistent=0)[source]

Build differential modify list for calling LDAPObject.modify()/modify_s()

Parameters:
  • old_entry – Dictionary holding the old entry
  • new_entry – Dictionary holding what the new entry should be
  • ignore_attr_types – List of attribute type names to be ignored completely
  • ignore_oldexistent – If non-zero attribute type names which are in old_entry but are not found in new_entry at all are not deleted. This is handy for situations where your application sets attribute value to ‘’ for deleting an attribute. In most cases leave zero.
Returns:

List of tuples suitable for ldap.LDAPObject.modify().

This function is the same as ldap.modlist.modifyModlist() except for the following changes:

  • MOD_DELETE/MOD_DELETE used in preference to MOD_REPLACE when updating an existing value.