mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Raise the right exceptions
This commit is contained in:
parent
250734aea5
commit
399b3794fb
@ -396,8 +396,7 @@ class IPAdmin(SimpleLDAPObject):
|
|||||||
modlist = self.generateModList(oldentry, newentry)
|
modlist = self.generateModList(oldentry, newentry)
|
||||||
|
|
||||||
if len(modlist) == 0:
|
if len(modlist) == 0:
|
||||||
# FIXME: better error
|
raise errors.EmptyModlist
|
||||||
raise SyntaxError("empty modlist")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if sctrl is not None:
|
if sctrl is not None:
|
||||||
@ -407,9 +406,9 @@ class IPAdmin(SimpleLDAPObject):
|
|||||||
# it indicates the previous attribute was removed by another
|
# it indicates the previous attribute was removed by another
|
||||||
# update, making the oldentry stale.
|
# update, making the oldentry stale.
|
||||||
except ldap.NO_SUCH_ATTRIBUTE:
|
except ldap.NO_SUCH_ATTRIBUTE:
|
||||||
raise ipaldap.MidairCollision
|
raise errors.MidairCollision
|
||||||
except ldap.LDAPError, e:
|
except ldap.LDAPError, e:
|
||||||
raise ipaldap.DatabaseError, e
|
raise errors.DatabaseError, e
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def generateModList(self, old_entry, new_entry):
|
def generateModList(self, old_entry, new_entry):
|
||||||
|
Loading…
Reference in New Issue
Block a user