Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Created December 9, 2014 15:57
Show Gist options
  • Save nelsnelson/4db0f643411c6f130d02 to your computer and use it in GitHub Desktop.
Save nelsnelson/4db0f643411c6f130d02 to your computer and use it in GitHub Desktop.
def wait_for_devstack_gate_to_finish(server):
limit = time.time() + 30000
try:
while time.time() < limit:
time.sleep(20)
result = ''
try:
result = remote(server, user='jenkins', command='[[ -f /tmp/gate-finished ]] && echo done')
except Exception as ex:
log.error("Error waiting for devstack-gate to finish: {}".format(ex.message))
if len(result) > 0:
return
log.warning('Timed out waiting for /tmp/gate-finished')
except KeyboardInterrupt as ex:
print "\nInterrupted"
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment