summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-08-13 09:27:13 -0400
committerRob Crittenden <rcritten@redhat.com>2009-08-20 09:20:56 -0400
commitd9c54cd83e8c676e34497fa135786a626d5d1fc7 (patch)
tree9f0b4defe1bbc50d96cfedabf5d2b591de8eac53 /ipalib
parent8780751330871033b13fc8fbb7eb0588baf4417d (diff)
downloadfreeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.tar.gz
freeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.tar.xz
freeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.zip
Clean up additional issues discovered with pylint and pychecker
Diffstat (limited to 'ipalib')
-rwxr-xr-xipalib/aci.py2
-rw-r--r--ipalib/errors.py16
-rw-r--r--ipalib/plugins/group.py2
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