From 4bd4024ae473e1e4a4c0f27d9292b9c70a6d536f Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 15 May 2015 14:48:21 -0700 Subject: [PATCH] task/internal: account for locked machines acquired on previous loops Signed-off-by: Dan Mick --- teuthology/task/internal.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index fab49bd84a..6897e66ee0 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) -- 2.39.5