diff options
Diffstat (limited to 'ipa_server/ipaldap.py')
-rw-r--r-- | ipa_server/ipaldap.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ipa_server/ipaldap.py b/ipa_server/ipaldap.py index 7cfd6c41f..f520475e5 100644 --- a/ipa_server/ipaldap.py +++ b/ipa_server/ipaldap.py @@ -375,7 +375,7 @@ class IPAdmin(SimpleLDAPObject): except ldap.ALREADY_EXISTS, e: raise errors.DuplicateEntry, "Entry already exists" except ldap.LDAPError, e: - raise e + raise DatabaseError, e return True def updateRDN(self, dn, newrdn): @@ -392,7 +392,7 @@ class IPAdmin(SimpleLDAPObject): self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.modrdn_s(dn, newrdn, delold=1) except ldap.LDAPError, e: - raise e + raise DatabaseError, e return True def updateEntry(self,dn,oldentry,newentry): @@ -474,7 +474,7 @@ class IPAdmin(SimpleLDAPObject): self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.modify_s(dn, modlist) except ldap.LDAPError, e: - raise e + raise DatabaseError, e return True def deleteEntry(self,*args): @@ -486,8 +486,10 @@ class IPAdmin(SimpleLDAPObject): if sctrl is not None: self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.delete_s(*args) + except ldap.INSUFFICIENT_ACCESS, e: + raise errors.InsufficientAccess, e except ldap.LDAPError, e: - raise e + raise errors.DatabaseError, e return True def modifyPassword(self,dn,oldpass,newpass): @@ -533,7 +535,10 @@ def notfound(args): if len(args) > 2: searchfilter = args[2] try: + # Python re doesn't do paren counting so the string could + # have a trailing paren "foo)" target = re.match(r'\(.*=(.*)\)', searchfilter).group(1) + target = target.replace(")","") except: target = searchfilter return "%s not found" % str(target) |