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.

--
David Kupka
From bd7ed8ca7a43a423603d744a6081a49450fdc9af 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..9ac9c7cd3595709d476687ee2efbe342a8ae0f6b 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(message=_('Paramters can not be used together: \'gid\', \'external\''))
         elif not options['nonposix']:
             entry_attrs['objectclass'].append('posixgroup')
             if not 'gidnumber' in options:
-- 
2.1.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to