mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #11462 from terminalmage/non-string-args
Properly handle non-string args
This commit is contained in:
commit
4ad4f8af34
@ -184,7 +184,9 @@ def _salt(fun, *args, **kw):
|
||||
}.get(fun, '120'))
|
||||
while wait_for_res:
|
||||
wait_for_res -= 0.5
|
||||
cret = runner.cmd('jobs.lookup_jid', [jid, 'output=false'])
|
||||
cret = runner.cmd(
|
||||
'jobs.lookup_jid',
|
||||
[jid, {'__kwarg__': True, 'output': False}])
|
||||
if target in cret:
|
||||
ret = cret[target]
|
||||
break
|
||||
|
@ -39,6 +39,16 @@ def parse_input(args, condition=True):
|
||||
_kwargs[arg_name] = yamlify_arg(arg_value)
|
||||
else:
|
||||
_args.append(yamlify_arg(arg))
|
||||
elif isinstance(arg, dict):
|
||||
# Yes, we're popping this key off and adding it back if
|
||||
# condition_input is called below, but this is the only way to
|
||||
# gracefully handle both CLI and API input.
|
||||
if arg.pop('__kwarg__', False) is True:
|
||||
_kwargs.update(arg)
|
||||
else:
|
||||
_args.append(arg)
|
||||
else:
|
||||
_args.append(arg)
|
||||
if condition:
|
||||
return condition_input(_args, _kwargs)
|
||||
return _args, _kwargs
|
||||
|
Loading…
Reference in New Issue
Block a user