1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

corrected some errors/typos and missing import

This commit is contained in:
Brian Coca 2017-02-27 11:27:18 -05:00
parent e16b907114
commit 6cb9f2bf65

View file

@ -33,6 +33,7 @@ import subprocess
import glob import glob
import select import select
import pickle import pickle
import platform
import traceback import traceback
from ansible.module_utils.six import PY2, b from ansible.module_utils.six import PY2, b
@ -154,7 +155,7 @@ def daemonize(module, cmd):
# make sure we always use byte strings # make sure we always use byte strings
run_cmd = [] run_cmd = []
for c in cmd: for c in cmd:
end_cmd.append(to_bytes(c, errors=errors)) run_cmd.append(to_bytes(c, errors=errors))
# execute the command in forked process # execute the command in forked process
p = subprocess.Popen(run_cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=lambda: os.close(pipe[1])) p = subprocess.Popen(run_cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=lambda: os.close(pipe[1]))
@ -197,7 +198,7 @@ def daemonize(module, cmd):
rfd, wfd, efd = select.select([pipe[0]], [], [pipe[0]]) rfd, wfd, efd = select.select([pipe[0]], [], [pipe[0]])
if pipe[0] in rfd: if pipe[0] in rfd:
data = os.read(pipe[0], chunk) data = os.read(pipe[0], chunk)
if not dat: if not data:
break break
return_data += b(data) return_data += b(data)