From: Michael S. <mi...@st...> - 2009-09-09 13:58:52
|
Zhang Huangbin wrote: > > On Sep 9, 2009, at 9:48 PM, Michael Ströder wrote: > >> BTW: That's why >> ldap.modlist.modifyModlist() was implemented. > > Any example? > > There is no example in official python-ldap document: > http://www.python-ldap.org/doc/html/ldap-modlist.html?highlight=modifymodlist#ldap.modlist.modifyModlist >>> import ldap.modlist >>> ldap.modlist.modifyModlist({'cn':'Mike'},{'cn':'Michael Stroeder','mail':'mi...@st...'}) [(0, 'mail', 'mi...@st...'), (1, 'cn', None), (0, 'cn', 'Michael Stroeder')] So basically you read the old_entry dict with an search operation, derive a new_entry dict from it, tweak that and pass old_entry and new_entry to this function. Ciao, Michael. |