]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Retry listing machines if the lock server goes down.
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 5 Oct 2011 00:19:56 +0000 (17:19 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Wed, 5 Oct 2011 00:21:00 +0000 (17:21 -0700)
teuthology/task/internal.py

index baf93a407969db40c0754d87a9426201418c8241..a448fa96ea570e8a04108c4ba07f37eb72316e21 100644 (file)
@@ -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'