]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock_machines: Linter fixes
authorZack Cerza <zack@redhat.com>
Wed, 15 Mar 2017 22:17:59 +0000 (16:17 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 21 Mar 2017 19:38:20 +0000 (13:38 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/internal/lock_machines.py

index 96b5eec632c0f77f8f4fa4a3ec978a7074041cc9..41cfde005acc331c233d94c00179760c31862466 100644 (file)
@@ -47,8 +47,9 @@ def lock_machines(ctx, config):
     requested = total_requested
     while True:
         # get a candidate list of machines
-        machines = teuthology.lock.query.list_locks(machine_type=machine_type, up=True,
-                                                    locked=False, count=requested + reserved)
+        machines = teuthology.lock.query.list_locks(
+            machine_type=machine_type, up=True, locked=False, count=requested +
+            reserved)
         if machines is None:
             if ctx.block:
                 log.error('Error listing machines, trying again')
@@ -58,10 +59,12 @@ def lock_machines(ctx, config):
                 raise RuntimeError('Error listing machines')
 
         # make sure there are machines for non-automated jobs to run
-        if len(machines) < reserved + requested and ctx.owner.startswith('scheduled'):
+        if (len(machines) < reserved + requested and
+                ctx.owner.startswith('scheduled')):
             if ctx.block:
                 log.info(
-                    'waiting for more %s machines to be free (need %s + %s, have %s)...',
+                    'waiting for more %s machines to be free '
+                    '(need %s + %s, have %s)...',
                     machine_type,
                     reserved,
                     requested,
@@ -74,9 +77,9 @@ def lock_machines(ctx, config):
                            (reserved, requested, len(machines)))
 
         try:
-            newly_locked = teuthology.lock.ops.lock_many(ctx, requested, machine_type,
-                                                         ctx.owner, ctx.archive, os_type,
-                                                         os_version, arch)
+            newly_locked = teuthology.lock.ops.lock_many(
+                ctx, requested, machine_type, ctx.owner, ctx.archive, os_type,
+                os_version, arch)
         except Exception:
             # Lock failures should map to the 'dead' status instead of 'fail'
             set_status(ctx.summary, 'dead')
@@ -157,4 +160,5 @@ def lock_machines(ctx, config):
         if get_status(ctx.summary) == 'pass' or unlock_on_failure:
             log.info('Unlocking machines...')
             for machine in ctx.config['targets'].iterkeys():
-                teuthology.lock.ops.unlock_one(ctx, machine, ctx.owner, ctx.archive)
+                teuthology.lock.ops.unlock_one(
+                    ctx, machine, ctx.owner, ctx.archive)