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:
Michael DeHaan 2012-03-11 20:54:54 -04:00
commit db7ba87111
4 changed files with 71 additions and 50 deletions

View file

@ -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)