Don't use binary mode for cmdmod.exec_code

Fixes #34196
This commit is contained in:
Lukas Raska 2016-06-22 12:11:34 +02:00
parent a8429c2595
commit 04553cd3de

View file

@ -2272,7 +2272,7 @@ def exec_code_all(lang, code, cwd=None):
salt '*' cmd.exec_code_all ruby 'puts "cheese"'
'''
codefile = salt.utils.mkstemp()
with salt.utils.fopen(codefile, 'w+t') as fp_:
with salt.utils.fopen(codefile, 'w+t', binary=False) as fp_:
fp_.write(code)
cmd = [lang, codefile]
ret = run_all(cmd, cwd=cwd, python_shell=False)