mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
make exec_code run without a shell
This commit is contained in:
parent
c5a8d14ada
commit
c558748b5f
@ -1225,9 +1225,8 @@ def exec_code(lang, code, cwd=None):
|
||||
codefile = salt.utils.mkstemp()
|
||||
with salt.utils.fopen(codefile, 'w+t') as fp_:
|
||||
fp_.write(code)
|
||||
|
||||
cmd = '{0} {1}'.format(lang, codefile)
|
||||
ret = run(cmd, cwd=cwd)
|
||||
cmd = [lang, codefile]
|
||||
ret = run(cmd, cwd=cwd, python_shell=False)
|
||||
os.remove(codefile)
|
||||
return ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user