From: Sage Weil Date: Fri, 29 Mar 2013 19:19:46 +0000 (-0700) Subject: do not archive on pass if 'archive-on-error: True' X-Git-Tag: 1.1.0~2211 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aeb1bbe414dbcebeeb10e8ce61adae9d248852f0;p=teuthology.git do not archive on pass if 'archive-on-error: True' 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 --- diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 66ac497b6c..07028aa974 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -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') diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 1adb05992a..3b1412e65f 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -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():