mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix a KeyError if group is provided but not user
This commit is contained in:
parent
9199101ef2
commit
c738a0de76
1 changed files with 4 additions and 4 deletions
|
@ -491,7 +491,7 @@ def wait(name,
|
|||
'Replace them with runas. '
|
||||
'These arguments will be removed in Salt Oxygen.'
|
||||
)
|
||||
if kwargs['user'] is not None and runas is None:
|
||||
if 'user' in kwargs and kwargs['user'] is not None and runas is None:
|
||||
runas = kwargs.pop('user')
|
||||
|
||||
# Ignoring our arguments is intentional.
|
||||
|
@ -622,7 +622,7 @@ def wait_script(name,
|
|||
'Replace them with runas. '
|
||||
'These arguments will be removed in Salt Oxygen.'
|
||||
)
|
||||
if kwargs['user'] is not None and runas is None:
|
||||
if 'user' in kwargs and kwargs['user'] is not None and runas is None:
|
||||
runas = kwargs.pop('user')
|
||||
|
||||
# Ignoring our arguments is intentional.
|
||||
|
@ -805,7 +805,7 @@ def run(name,
|
|||
'Replace them with runas. '
|
||||
'These arguments will be removed in Salt Oxygen.'
|
||||
)
|
||||
if kwargs['user'] is not None and runas is None:
|
||||
if 'user' in kwargs and kwargs['user'] is not None and runas is None:
|
||||
runas = kwargs.pop('user')
|
||||
|
||||
cmd_kwargs = {'cwd': cwd,
|
||||
|
@ -1041,7 +1041,7 @@ def script(name,
|
|||
'Replace them with runas. '
|
||||
'These arguments will be removed in Salt Oxygen.'
|
||||
)
|
||||
if kwargs['user'] is not None and runas is None:
|
||||
if 'user' in kwargs and kwargs['user'] is not None and runas is None:
|
||||
runas = kwargs.pop('user')
|
||||
|
||||
cmd_kwargs = copy.deepcopy(kwargs)
|
||||
|
|
Loading…
Add table
Reference in a new issue