]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix broken lambda
authorZack Cerza <zack@cerza.org>
Fri, 11 Oct 2013 20:10:54 +0000 (15:10 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 11 Oct 2013 21:24:54 +0000 (16:24 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/task/internal.py

index a9804fda9a257f3f8317efb1c758700ef2986ca9..4ef4923e156653841ce288063281c2a1633bcf55 100644 (file)
@@ -64,14 +64,15 @@ def lock_machines(ctx, config):
                 continue
             else:
                 assert 0, 'error listing machines'
-        num_up = len(filter(lambda machine: machine['up'] and machine['type']
-                            == machine_type, machines))
+
+        is_up = lambda machine: machine['up'] and machine['type'] == machine_type  # noqa
+        num_up = len(filter(is_up, machines))
         assert num_up >= how_many, 'not enough machines are up'
 
         # make sure there are machines for non-automated jobs to run
-        num_free = len(filter(lambda machine: machine['up'] and
-                              machine['locked'] == 0 and machine['type'] ==
-                              machine_type, machines))
+        is_up_and_free = lambda machine: machine['up'] and machine['locked'] == 0 and machine['type'] == machine_type  # noqa
+        up_and_free = filter(is_up_and_free, machines)
+        num_free = len(up_and_free)
         if num_free < 6 and ctx.owner.startswith('scheduled'):
             if ctx.block:
                 log.info(