From: Dan Mick Date: Mon, 27 Oct 2014 22:26:36 +0000 (-0700) Subject: internal.py: report more-accurate info about locked machines X-Git-Tag: 1.1.0~1096^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F349%2Fhead;p=teuthology.git internal.py: report more-accurate info about locked machines Don't hide the fact that there are reserved machines that may cause a scheduled lock request to have to wait. Fixes: 9914 Signed-off-by: Dan Mick --- diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index bb0e7a006..13e6ab1cd 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -87,17 +87,19 @@ def lock_machines(ctx, config): raise RuntimeError('Error listing machines') # make sure there are machines for non-automated jobs to run - if len(machines) <= to_reserve and ctx.owner.startswith('scheduled'): + if len(machines) <= to_reserve + how_many and ctx.owner.startswith('scheduled'): if ctx.block: log.info( - 'waiting for more machines to be free (need %s see %s)...', + 'waiting for more machines to be free (need %s + %s, have %s)...', + to_reserve, how_many, len(machines), ) time.sleep(10) continue else: - assert 0, 'not enough machines free' + assert 0, ('not enough machines free; need %s + %s, have %s' % + (to_reserve, how_many, len(machines))) newly_locked = lock.lock_many(ctx, how_many, machine_type, ctx.owner, ctx.archive, os_type, os_version, arch)