From aeb1bbe414dbcebeeb10e8ce61adae9d248852f0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 29 Mar 2013 12:19:46 -0700 Subject: [PATCH] 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 --- teuthology/task/ceph.py | 7 ++++++- teuthology/task/internal.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 66ac497b6c7e3..07028aa974eb6 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 1adb05992af52..3b1412e65fd6c 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(): -- 2.39.5