Add async polling logic to runner. Will add to playbook shortly, have to diagnose why paramiko

is not letting async_wrapper daemonize itself when it does work fine when directly executed.
This commit is contained in:
Michael DeHaan 2012-03-11 18:40:35 -04:00
parent bc321b7cdc
commit 2fafe74544

View file

@ -67,7 +67,7 @@ def _run_command(wrapped_cmd, jid, log_path):
try:
cmd = shlex.split(wrapped_cmd)
script = subprocess.Popen(cmd, shell=False,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = script.communicate()
result = json.loads(out)
@ -94,7 +94,7 @@ def _run_command(wrapped_cmd, jid, log_path):
pid = os.fork()
if pid == 0:
# "RETURNING SUCCESS IN UNO"
"RETURNING SUCCESS IN UNO"
print json.dumps({ "started" : 1, "ansible_job_id" : jid })
sys.exit(0)
else: