From: Zack Cerza Date: Mon, 19 May 2014 22:53:22 +0000 (-0500) Subject: Update do_summary() X-Git-Tag: 1.1.0~1244 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af2a03a8a5b51eb102162aa2d6b729ea188c535c;p=teuthology.git Update do_summary() Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock.py b/teuthology/lock.py index f2dbd035..83513fb6 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]))