From: Dan Mick Date: Fri, 15 May 2015 21:48:21 +0000 (-0700) Subject: task/internal: account for locked machines acquired on previous loops X-Git-Tag: 1.1.0~939^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F496%2Fhead;p=teuthology.git task/internal: account for locked machines acquired on previous loops Signed-off-by: Dan Mick --- diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index fab49bd8..6897e66e 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -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)