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.
reviewable/pr18780/r1
Michael DeHaan 13 years ago
parent bc321b7cdc
commit 2fafe74544

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

Loading…
Cancel
Save