]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/internal: account for locked machines acquired on previous loops 496/head
authorDan Mick <dan.mick@redhat.com>
Fri, 15 May 2015 21:48:21 +0000 (14:48 -0700)
committerDan Mick <dan.mick@redhat.com>
Fri, 15 May 2015 22:50:03 +0000 (15:50 -0700)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/task/internal.py

index fab49bd84afe8ff48a25a84d5e2dcc70a57e499d..6897e66ee02f27b1b0a7621e32306230e9586511 100644 (file)
@@ -159,6 +159,10 @@ def lock_machines(ctx, config):
             break
         elif not ctx.block:
             assert 0, 'not enough machines are available'
+        else:
+            how_many = how_many - len(newly_locked)
+            assert how_many > 0, "lock_machines: how_many counter went" \
+                                 "negative, this shouldn't happen"
 
         log.warn('Could not lock enough machines, waiting...')
         time.sleep(10)