Add rename_object method

This commit is contained in:
Benjamin Renard 2015-04-01 17:08:26 +02:00
parent 0a10f2f984
commit 4faaf2c3ad

View file

@ -82,6 +82,16 @@ class LdapServer(object):
self._error("LdapServer - Error updating %s : %s" % (dn,e))
return False
def rename_object(self,dn,new_rdn):
try:
logging.debug("LdapServer - Rename %s in %s" % (dn,new_rdn))
self.con.rename_s(dn,new_rdn)
return True
except ldap.LDAPError, e:
self._error("LdapServer - Error renaming %s in %s : %s" % (dn,new_rdn,e))
return False
def drop_object(self,dn):
try:
logging.debug("LdapServer - Delete %s" % dn)