diff options
author | Jan Zeleny <jzeleny@redhat.com> | 2010-11-29 09:37:47 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-11-29 17:19:40 -0500 |
commit | 58bcb5e7f9eb5e249bf19f562dcfcf7acddc6987 (patch) | |
tree | d1f503a45273fb33941bdd2119b3857ed5cf4899 /ipalib | |
parent | df48c9cf7114eca33a7586f2208e406ce28d0168 (diff) | |
download | freeipa-58bcb5e7f9eb5e249bf19f562dcfcf7acddc6987.tar.gz freeipa-58bcb5e7f9eb5e249bf19f562dcfcf7acddc6987.tar.xz freeipa-58bcb5e7f9eb5e249bf19f562dcfcf7acddc6987.zip |
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
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/hbac.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/plugins/hbac.py b/ipalib/plugins/hbac.py index d00bcc08e..17154e937 100644 --- a/ipalib/plugins/hbac.py +++ b/ipalib/plugins/hbac.py @@ -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) |