diff options
Diffstat (limited to 'ipalib')
-rwxr-xr-x | ipalib/aci.py | 2 | ||||
-rw-r--r-- | ipalib/errors.py | 16 | ||||
-rw-r--r-- | ipalib/plugins/group.py | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/ipalib/aci.py b/ipalib/aci.py index 926334c35..3c4b2acb6 100755 --- a/ipalib/aci.py +++ b/ipalib/aci.py @@ -268,7 +268,7 @@ def extract_group_cns(aci_list, client): try: group = client.get_entry_by_dn(dn, ['cn']) group_dn_to_cn[dn] = group.getValue('cn') - except ipaerror.IPAError, e: + except Exception: group_dn_to_cn[dn] = 'unknown' return group_dn_to_cn diff --git a/ipalib/errors.py b/ipalib/errors.py index caecdc382..2edefa746 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -1008,6 +1008,22 @@ class SameGroupError(ExecutionError): errno = 4017 format = _('A group may not be added as a member of itself') +class DefaultGroupError(ExecutionError): + """ + **4018** Raised when removing the default user group + + For example: + + >>> raise DefaultGroupError() + Traceback (most recent call last): + ... + DefaultGroupError: The default users group cannot be removed + + """ + + errno = 4018 + format = _('The default users group cannot be removed') + class BuiltinError(ExecutionError): """ **4100** Base class for builtin execution errors (*4100 - 4199*). diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py index 7acb40e49..4fe37ba44 100644 --- a/ipalib/plugins/group.py +++ b/ipalib/plugins/group.py @@ -117,7 +117,7 @@ class group_del(basegroup_del): 'cn', def_group_cn, self.filter_class, [''], self.container ) if dn == def_group_dn: - raise errors.DefaultGroup() + raise errors.DefaultGroupError() except errors.NotFound: pass |