Commits

Ivan Fedorov committed d156337

Raise ldap.ALREADY_EXISTS on renaming to exists object

  • Participants
  • Parent commits b989d9d

Comments (0)

Files changed (1)

File src/mockldap/ldapobject.py

             superior = ','.join(dn.split(',')[1:])
 
         newfulldn = '%s,%s' % (newrdn, superior)
+        if newfulldn in self.directory:
+            raise ldap.ALREADY_EXISTS
+
         oldattr, oldvalue = dn.split(',')[0].split('=')
         newattr, newvalue = newrdn.split('=')