From 107db6a913e58201ed51b097881979539723a139 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 4 Oct 2011 17:19:56 -0700 Subject: [PATCH] Retry listing machines if the lock server goes down. --- teuthology/task/internal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index baf93a4079..a448fa96ea 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -53,7 +53,13 @@ def lock_machines(ctx, config): while True: # make sure there are enough machines up machines = lock.list_locks(ctx) - assert machines is not None, 'error listing machines' + if machines is None: + if ctx.block: + log.warn('error listing machines, trying again') + time.sleep(20) + continue + else: + assert 0, 'error listing machines' num_up = len(filter(lambda machine: machine['up'], machines)) assert num_up >= config, 'not enough machines are up' -- 2.39.5