+

Add rename_object method

Benjamin Renard [2015-04-01 15:08:26]
Add rename_object method
Filename
LdapServer.py
diff --git a/LdapServer.py b/LdapServer.py
index 4c4c9e5..2453ad1 100644
--- a/LdapServer.py
+++ b/LdapServer.py
@@ -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)
ViewGit