From 2fafe745447a154c27570b5258e156e1a28eb2f5 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 11 Mar 2012 18:40:35 -0400 Subject: [PATCH] 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. --- async_wrapper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/async_wrapper b/async_wrapper index fefa4bb81f4..8371a6e5c77 100755 --- a/async_wrapper +++ b/async_wrapper @@ -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: