mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
33066c56fd
commit
24f9c8f8d9
@ -181,7 +181,7 @@ def _exec_cmd(*args, **kwargs):
|
||||
result = __salt__['cmd.run_all']('script -q -c "{0}" {1}'.format(cmd_exec, filename))
|
||||
|
||||
# Read the output from the script command, stripping the first line
|
||||
with open(filename, 'r') as outfile:
|
||||
with salt.utils.fopen(filename, 'r') as outfile:
|
||||
stdout = outfile.readlines()
|
||||
result['stdout'] = ''.join(stdout[1:])
|
||||
os.remove(filename)
|
||||
|
Loading…
Reference in New Issue
Block a user