cmdmod: Don't list-ify string commands on Windows

See https://github.com/saltstack/salt/issues/43522.
This commit is contained in:
Erik Johnson 2017-09-28 13:10:03 -05:00
parent ea8d273c2b
commit d8708bf698
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -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: