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:
parent
bc321b7cdc
commit
2fafe74544
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue