On 11/13/2014 11:24 AM, Jan Cholasta wrote:
Dne 10.11.2014 v 13:24 David Kupka napsal(a):
On 11/10/2014 08:20 AM, Jan Cholasta wrote:
Hi,
Dne 7.11.2014 v 15:26 David Kupka napsal(a):
https://fedorahosted.org/freeipa/ticket/4611
I think you should use MutuallyExclusiveError.
Honza
Thanks, that's the error class I was searching for. Unfortunately, I
didn't know this one so I used more abstract error class.
Fixed patch attached.
Given the messages that are used for MutuallyExclusiveError everywhere
else in the framework, I think a better message would be "gid cannot be
set for external group".
Fixed patch attached.
--
David Kupka
From dddadcc5c3ed5aff3880b7794d6d7ba7aae66d88 Mon Sep 17 00:00:00 2001
From: David Kupka <dku...@redhat.com>
Date: Wed, 5 Nov 2014 02:40:10 -0500
Subject: [PATCH] Produce better error in group-add command.
https://fedorahosted.org/freeipa/ticket/4611
---
ipalib/plugins/group.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py
index 03e6893e3c7604268b503b28ea39ed3f610aec47..d25ed9a1958119a5872db85e958323fdb8205366 100644
--- a/ipalib/plugins/group.py
+++ b/ipalib/plugins/group.py
@@ -287,7 +287,7 @@ class group_add(LDAPCreate):
if options['external']:
entry_attrs['objectclass'].append('ipaexternalgroup')
if 'gidnumber' in options:
- raise errors.RequirementError(name='gid')
+ raise errors.MutuallyExclusiveError(reason=_('gid cannot be set for external group'))
elif not options['nonposix']:
entry_attrs['objectclass'].append('posixgroup')
if not 'gidnumber' in options:
--
1.9.3
_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel