summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-02-02 15:29:38 +0100
committerRob Crittenden <rcritten@redhat.com>2011-02-03 10:33:22 -0500
commitc9ff669cdd7906fcd463a33f3468623e27116f52 (patch)
tree8923c0d9c2b2e4035cd620555f9283d80d4c8bdc
parenta686f36906913ea0594f87cf3cc92b879d628301 (diff)
downloadfreeipa-c9ff669cdd7906fcd463a33f3468623e27116f52.tar.gz
freeipa-c9ff669cdd7906fcd463a33f3468623e27116f52.tar.xz
freeipa-c9ff669cdd7906fcd463a33f3468623e27116f52.zip
Inconsistent error message for ipa group-detach
When attempting to detach a private group that doesn't exist, the error message returned is not consistent with the error returned by the other topic commands. This patch adds a standard message. https://fedorahosted.org/freeipa/ticket/291
-rw-r--r--ipalib/plugins/group.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py
index 078d535b0..b981731e3 100644
--- a/ipalib/plugins/group.py
+++ b/ipalib/plugins/group.py
@@ -294,7 +294,10 @@ class group_detach(LDAPQuery):
group_dn = self.obj.get_dn(*keys, **options)
user_dn = self.api.Object['user'].get_dn(*keys)
- (user_dn, user_attrs) = ldap.get_entry(user_dn)
+ try:
+ (user_dn, user_attrs) = ldap.get_entry(user_dn)
+ except errors.NotFound:
+ self.obj.handle_not_found(*keys)
is_managed = self.obj.has_objectclass(user_attrs['objectclass'], 'mepmanagedentry')
if (not ldap.can_write(user_dn, "objectclass") or
not (ldap.can_write(user_dn, "mepManagedEntry")) and is_managed):