mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-25 14:40:16 -05:00
Enhance error message when adding non-posix group with a GID
Enhance error message when adding non-posix group with a GID so the user knows that a GID should not be passed when adding a group with the --nonposix option. Fixes: https://pagure.io/freeipa/issue/8155 Signed-off-by: Antonio Torres <antorres@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
1 parent
cfff1f6710
commit
28d310d5b0
1 file changed
+9
@@ -387,6 +387,15 @@ class group_add(LDAPCreate):
|
||||
entry_attrs['gidnumber'] = baseldap.DNA_MAGIC
|
||||
return dn
|
||||
|
||||
def exc_callback(self, keys, options, exc, call_func,
|
||||
*call_args, **call_kwargs):
|
||||
if isinstance(exc, errors.ObjectclassViolation):
|
||||
if options['nonposix'] and 'gidnumber' in options:
|
||||
raise errors.ObjectclassViolation(
|
||||
info=_('attribute "gidNumber" not allowed with --nonposix')
|
||||
)
|
||||
raise exc
|
||||
|
||||
|
||||
@register()
|
||||
class group_del(LDAPDelete):
|
||||
|
||||
Reference in new issue
Block a user