From af2a03a8a5b51eb102162aa2d6b729ea188c535c Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 19 May 2014 17:53:22 -0500 Subject: [PATCH] Update do_summary() Signed-off-by: Zack Cerza --- teuthology/lock.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index f2dbd0355..83513fb6c 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -408,13 +408,12 @@ def scan_for_locks(ctx, machines): def do_summary(ctx): lockd = collections.defaultdict(lambda: [0, 0, 'unknown']) - for l in list_locks(): - if ctx.machine_type and l['type'] != ctx.machine_type: - continue - who = l['locked_by'] if l['locked'] == 1 else '(free)', l['type'] + for l in list_locks(ctx.machine_type): + who = l['locked_by'] if l['locked'] == 1 \ + else '(free)', l['machine_type'] lockd[who][0] += 1 - lockd[who][1] += l['up'] # up is 1 or 0 - lockd[who][2] = l['type'] + lockd[who][1] += 1 if l['up'] else 0 + lockd[who][2] = l['machine_type'] locks = sorted([p for p in lockd.iteritems() ], key=lambda sort: (sort[1][2], sort[1][0])) -- 2.47.3