Add rename_object method
Benjamin Renard

Benjamin Renard commited on 2015-04-01 15:08:26
Showing 1 changed files, with 10 additions and 0 deletions.

... ...
@@ -82,6 +82,16 @@ class LdapServer(object):
82 82
 			self._error("LdapServer - Error updating %s : %s" % (dn,e))
83 83
 		return False
84 84
 
85
+	def rename_object(self,dn,new_rdn):
86
+		try:
87
+			logging.debug("LdapServer - Rename %s in %s" % (dn,new_rdn))
88
+			self.con.rename_s(dn,new_rdn)
89
+			return True
90
+		except ldap.LDAPError, e:
91
+			self._error("LdapServer - Error renaming %s in %s : %s" % (dn,new_rdn,e))
92
+
93
+		return False
94
+
85 95
 	def drop_object(self,dn):
86 96
 		try:
87 97
 			logging.debug("LdapServer - Delete %s" % dn)
88 98