diff options
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/ipaldap.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index a490c3407..af17988be 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -381,6 +381,12 @@ class IPAdmin(SimpleLDAPObject): self.add_s(*args) except ldap.ALREADY_EXISTS, e: raise errors2.DuplicateEntry + except ldap.CONSTRAINT_VIOLATION, e: + # This error gets thrown by the uniqueness plugin + if e.args[0].get('info','') == 'Another entry with the same attribute value already exists': + raise errors2.DuplicateEntry + else: + raise errors.DatabaseError, e except ldap.LDAPError, e: raise errors.DatabaseError, e return True |