mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
pull out executable on windows
This commit is contained in:
parent
1e625de5c1
commit
6c10c17fbf
@ -94,15 +94,15 @@ def _run(cmd,
|
||||
|
||||
run_env = os.environ
|
||||
run_env.update(env)
|
||||
kwargs = {'cwd': cwd,
|
||||
'shell': True,
|
||||
'env': run_env,
|
||||
'stdout': stdout,
|
||||
'stderr':stderr}
|
||||
if not os.environ.get('os', '').startswith('Windows'):
|
||||
kwargs['executable'] = shell
|
||||
# This is where the magic happens
|
||||
proc = subprocess.Popen(cmd,
|
||||
executable=shell,
|
||||
cwd=cwd,
|
||||
shell=True,
|
||||
env=run_env,
|
||||
stdout=stdout,
|
||||
stderr=stderr
|
||||
)
|
||||
proc = subprocess.Popen(cmd, **kwargs)
|
||||
|
||||
out = proc.communicate()
|
||||
ret['stdout'] = out[0]
|
||||
|
Loading…
Reference in New Issue
Block a user