From e66dffc3d3a2fa42f129872b4b4f04c9e8c6d0f5 Mon Sep 17 00:00:00 2001 From: Sage Weil <sage@newdream.net> Date: Fri, 2 Sep 2011 11:07:10 -0700 Subject: [PATCH] don't eat exceptions for breakfast fixes 0c2bee1514c1b1e65ca5d52459062e5a45da2d7b --- teuthology/task/ceph.py | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 0a611d3791f..db19007dbb2 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -212,29 +212,29 @@ def valgrind_post(ctx, config): try: yield finally: - if not config.get('valgrind'): - return - lookup_procs = list() - val_path = '/tmp/cephtest/archive/log/{val_dir}/*'.format(val_dir=config.get('valgrind').get('logs', "valgrind")) - for remote in ctx.cluster.remotes.iterkeys(): - #look at valgrind logs for each node - proc = remote.run( - args=[ - 'grep', "<kind>", run.Raw(val_path), run.Raw('|'), - 'grep', '-v', '-q', "PossiblyLost"], - wait = False, - check_status=False - ) - lookup_procs.append((proc, remote)) - - valgrind_exception = None - for (proc, remote) in lookup_procs: - result = proc.exitstatus.get() - if result is not 1: - valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name)) - - if valgrind_exception is not None: - raise valgrind_exception + if config.get('valgrind'): + lookup_procs = list() + val_path = '/tmp/cephtest/archive/log/{val_dir}/*'.format( + val_dir=config.get('valgrind').get('logs', "valgrind")) + for remote in ctx.cluster.remotes.iterkeys(): + #look at valgrind logs for each node + proc = remote.run( + args=[ + 'grep', "<kind>", run.Raw(val_path), run.Raw('|'), + 'grep', '-v', '-q', "PossiblyLost"], + wait = False, + check_status=False + ) + lookup_procs.append((proc, remote)) + + valgrind_exception = None + for (proc, remote) in lookup_procs: + result = proc.exitstatus.get() + if result is not 1: + valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name)) + + if valgrind_exception is not None: + raise valgrind_exception @contextlib.contextmanager