From: Zack Cerza Date: Fri, 11 Oct 2013 20:10:54 +0000 (-0500) Subject: Fix broken lambda X-Git-Tag: 1.1.0~1805^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ca9092c644f8781d6d62eadfcd79e2f21e611e5;p=teuthology.git Fix broken lambda Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index a9804fda9..4ef4923e1 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -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(