mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-29 08:01:24 -07:00
Add polling logic in runner such that all actions get kicked off everywhere then polling
happens only on needed hosts, allowing some hosts to fail and drop out of the running.
This commit is contained in:
parent
49a636d8a0
commit
db7ba87111
4 changed files with 71 additions and 50 deletions
|
@ -175,12 +175,12 @@ def path_dwim(basedir, given):
|
|||
else:
|
||||
return os.path.join(basedir, given)
|
||||
|
||||
def async_poll_status(runner, clock, poll_interval, ok, host, jid, result):
|
||||
if ok and 'finished' in result:
|
||||
print "<job %s> finished on %s" % (jid, host)
|
||||
elif not ok or 'failed' in result:
|
||||
print "<job %s> FAILED on %s" % (jid, host)
|
||||
def async_poll_status(jid, host, clock, result):
|
||||
if 'finished' in result:
|
||||
return "<job %s> finished on %s" % (jid, host)
|
||||
elif 'failed' in result:
|
||||
return "<job %s> FAILED on %s" % (jid, host)
|
||||
else:
|
||||
print "<job %s> polling on %s, %s remaining" % (jid, host, clock)
|
||||
return "<job %s> polling on %s, %s remaining" % (jid, host, clock)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue