mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #6115 from hulu/extra-kwargs-err-check
Error on completely invalid kwd args; follow-up to #6093
This commit is contained in:
commit
6545fd96b2
4 changed files with 12 additions and 4 deletions
|
@ -33,8 +33,10 @@ def add(name, gid=None, **kwargs):
|
|||
|
||||
salt '*' group.add foo 3456
|
||||
'''
|
||||
if salt.utils.is_true(kwargs.get('system')):
|
||||
if salt.utils.is_true(kwargs.pop('system', False)):
|
||||
log.warning('pw_group module does not support the \'system\' argument')
|
||||
if kwargs:
|
||||
raise TypeError('Invalid keyword argument(s): {}'.format(kwargs))
|
||||
|
||||
cmd = 'pw groupadd '
|
||||
if gid:
|
||||
|
|
|
@ -73,8 +73,10 @@ def add(name,
|
|||
|
||||
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
|
||||
'''
|
||||
if salt.utils.is_true(kwargs.get('system')):
|
||||
if salt.utils.is_true(kwargs.pop('system', False)):
|
||||
log.warning('pw_user module does not support the \'system\' argument')
|
||||
if kwargs:
|
||||
raise TypeError('Invalid keyword argument(s): {}'.format(kwargs))
|
||||
|
||||
if isinstance(groups, string_types):
|
||||
groups = groups.split(',')
|
||||
|
|
|
@ -33,9 +33,11 @@ def add(name, gid=None, **kwargs):
|
|||
|
||||
salt '*' group.add foo 3456
|
||||
'''
|
||||
if salt.utils.is_true(kwargs.get('system')):
|
||||
if salt.utils.is_true(kwargs.pop('system', False)):
|
||||
log.warning('solaris_group module does not support the \'system\' '
|
||||
'argument')
|
||||
if kwargs:
|
||||
raise TypeError('Invalid keyword argument(s): {}'.format(kwargs))
|
||||
|
||||
cmd = 'groupadd '
|
||||
if gid:
|
||||
|
|
|
@ -74,9 +74,11 @@ def add(name,
|
|||
|
||||
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
|
||||
'''
|
||||
if salt.utils.is_true(kwargs.get('system')):
|
||||
if salt.utils.is_true(kwargs.pop('system', False)):
|
||||
log.warning('solaris_user module does not support the \'system\' '
|
||||
'argument')
|
||||
if kwargs:
|
||||
raise TypeError('Invalid keyword argument(s): {}'.format(kwargs))
|
||||
|
||||
if isinstance(groups, string_types):
|
||||
groups = groups.split(',')
|
||||
|
|
Loading…
Add table
Reference in a new issue