]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
do not archive on pass if 'archive-on-error: True'
authorSage Weil <sage@inktank.com>
Fri, 29 Mar 2013 19:19:46 +0000 (12:19 -0700)
committerSage Weil <sage@inktank.com>
Fri, 29 Mar 2013 21:27:20 +0000 (14:27 -0700)
Optional flag makes us suck down the archive (mostly, the logs, which
might be huge for some debugging tests) unless the test has failed.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/ceph.py
teuthology/task/internal.py

index 66ac497b6c7e3b4db47516892743dd1c87b1895b..07028aa974eb6a6fc89063fc030ddc69b5be1e3c 100644 (file)
@@ -708,6 +708,10 @@ def cluster(ctx, config):
 
     try:
         yield
+    except:
+        # we need to know this below
+        ctx.summary['success'] = False
+        raise
     finally:
         (mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys()
 
@@ -769,7 +773,8 @@ def cluster(ctx, config):
                     check_status=False,
                 )
 
-        if ctx.archive is not None:
+        if ctx.archive is not None and \
+                not (ctx.config.get('archive-on-error') and ctx.summary['success']):
             # archive mon data, too
             log.info('Archiving mon data...')
             path = os.path.join(ctx.archive, 'data')
index 1adb05992af5275b3252d162c09bf6094c03a152..3b1412e65fd6cdbfd9932e630c49bc89f1e26d85 100644 (file)
@@ -251,8 +251,13 @@ def archive(ctx, config):
 
     try:
         yield
+    except:
+        # we need to know this below
+        ctx.summary['success'] = False
+        raise
     finally:
-        if ctx.archive is not None:
+        if ctx.archive is not None and \
+                not (ctx.config.get('archive-on-error') and ctx.summary['success']):
             log.info('Transferring archived files...')
             logdir = os.path.join(ctx.archive, 'remote')
             for remote in ctx.cluster.remotes.iterkeys():