mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Handle error messages during various HBAC operations
During some HBAC operations, various error messages were handled incorrectly - displaying only generic error messages instead of correct ones, which were defined for the module. This patch adds catching these generic exceptions and raising new exceptions with the correct error message. https://fedorahosted.org/freeipa/ticket/487
This commit is contained in:
parent
df48c9cf71
commit
58bcb5e7f9
@ -266,6 +266,8 @@ class hbac_enable(LDAPQuery):
|
||||
ldap.update_entry(dn, entry_attrs)
|
||||
except errors.EmptyModlist:
|
||||
pass
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(cn)
|
||||
|
||||
return dict(result=True)
|
||||
|
||||
@ -290,6 +292,8 @@ class hbac_disable(LDAPQuery):
|
||||
ldap.update_entry(dn, entry_attrs)
|
||||
except errors.EmptyModlist:
|
||||
pass
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(cn)
|
||||
|
||||
return dict(result=True)
|
||||
|
||||
@ -325,6 +329,8 @@ class hbac_add_accesstime(LDAPQuery):
|
||||
ldap.update_entry(dn, entry_attrs)
|
||||
except errors.EmptyModlist:
|
||||
pass
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(cn)
|
||||
|
||||
return dict(result=True)
|
||||
|
||||
@ -363,6 +369,8 @@ class hbac_remove_accesstime(LDAPQuery):
|
||||
ldap.update_entry(dn, entry_attrs)
|
||||
except (ValueError, errors.EmptyModlist):
|
||||
pass
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(cn)
|
||||
|
||||
return dict(result=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user