Raise the right exceptions

This commit is contained in:
Rob Crittenden 2008-10-13 14:58:08 -04:00
parent 250734aea5
commit 399b3794fb

View File

@ -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):