mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
Print expected error message in hbac-mod
This patch catches NotFound exception and calls handling function which then sends exception with unified error message. https://fedorahosted.org/freeipa/ticket/487
This commit is contained in:
parent
e8e274c9e0
commit
8fd288df08
@ -231,7 +231,11 @@ class hbac_mod(LDAPUpdate):
|
||||
"""
|
||||
|
||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||
(dn, entry_attrs) = ldap.get_entry(dn, attrs_list)
|
||||
try:
|
||||
(dn, entry_attrs) = ldap.get_entry(dn, attrs_list)
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(*keys)
|
||||
|
||||
if is_all(options, 'usercategory') and 'memberuser' in entry_attrs:
|
||||
raise errors.MutuallyExclusiveError(reason="user category cannot be set to 'all' while there are allowed users")
|
||||
if is_all(options, 'hostcategory') and 'memberhost' in entry_attrs:
|
||||
|
Loading…
Reference in New Issue
Block a user