This code snippet shows a simple function to rename an object's DN in eDirectory using python-ldap. Parameters: handle = connection handle as returned from __connect olddn = string representation of DN we are renaming from newdn = string representation of DN we are renaming to delete_olddn = default is 1, indicates to delete the olddn value if 1
import ldap
def __rename( handle, olddn, newdn, delete_olddn=1 ):
if not handle:
return False
handle.modrdn_s( olddn, newdn, delete_olddn )
© 2008 Novell, Inc. All Rights Reserved.