mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +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
1 changed files with 5 additions and 8 deletions
|
@ -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…
Add table
Reference in a new issue