]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: always try to process valgrind logs
authorSage Weil <sage@newdream.net>
Wed, 22 Feb 2012 00:10:37 +0000 (16:10 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Fri, 24 Feb 2012 20:05:35 +0000 (12:05 -0800)
Check for errors in valgrind logs even if there is no valgrind option
the ceph task config stanza.  Other tasks can run via valgrind (ceph-fuse,
rgw).  If the logs aren't there, this is harmless.

teuthology/task/ceph.py

index a04c22e3e1b2533b3ff73fdafc1aa99bd75bb886..eb316a3b240a1bc0fd839b9491a32d34f08ec040 100644 (file)
@@ -274,29 +274,30 @@ def valgrind_post(ctx, config):
     try:
         yield
     finally:
-        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('|'),
-                        'egrep', '-v', '-q', '(PossiblyLost|DefinitelyLost)'],
-                    wait = False,
-                    check_status=False
-                    )
-                lookup_procs.append((proc, remote))
+        vconfig = config.get('valgrind', {})
+        lookup_procs = list()
+        val_path = '/tmp/cephtest/archive/log/{val_dir}/*'.format(
+            val_dir=vconfig.get('logs', "valgrind"))
+        log.info('Checking for errors in any valgrind logs...');
+        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('|'),
+                    'egrep', '-v', '-q', '(PossiblyLost|DefinitelyLost)'],
+                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 != 1:
-                    valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name))
+        valgrind_exception = None
+        for (proc, remote) in lookup_procs:
+            result = proc.exitstatus.get()
+            if result != 1:
+                valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name))
 
-            if valgrind_exception is not None:
-                raise valgrind_exception
+        if valgrind_exception is not None:
+            raise valgrind_exception
                 
 
 @contextlib.contextmanager