mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
cmdmod: Don't list-ify string commands on Windows
See https://github.com/saltstack/salt/issues/43522.
This commit is contained in:
parent
ea8d273c2b
commit
d8708bf698
@ -378,9 +378,6 @@ def _run(cmd,
|
||||
msg = 'missing salt/utils/win_runas.py'
|
||||
raise CommandExecutionError(msg)
|
||||
|
||||
if not isinstance(cmd, list):
|
||||
cmd = salt.utils.shlex_split(cmd, posix=False)
|
||||
|
||||
cmd = ' '.join(cmd)
|
||||
|
||||
return win_runas(cmd, runas, password, cwd)
|
||||
@ -516,11 +513,11 @@ def _run(cmd,
|
||||
.format(cwd)
|
||||
)
|
||||
|
||||
if python_shell is not True and not isinstance(cmd, list):
|
||||
posix = True
|
||||
if salt.utils.is_windows():
|
||||
posix = False
|
||||
cmd = salt.utils.shlex_split(cmd, posix=posix)
|
||||
if python_shell is not True \
|
||||
and not salt.utils.is_windows() \
|
||||
and not isinstance(cmd, list):
|
||||
cmd = salt.utils.shlex_split(cmd)
|
||||
|
||||
if not use_vt:
|
||||
# This is where the magic happens
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user