]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
internal.py: report more-accurate info about locked machines 349/head
authorDan Mick <dan.mick@redhat.com>
Mon, 27 Oct 2014 22:26:36 +0000 (15:26 -0700)
committerDan Mick <dan.mick@redhat.com>
Mon, 27 Oct 2014 22:26:36 +0000 (15:26 -0700)
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 <dan.mick@redhat.com>
teuthology/task/internal.py

index bb0e7a0061219d364c5b016449d5893f4b89d4e1..13e6ab1cdc15311b4a61d7535c75670cda7f4740 100644 (file)
@@ -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)