From 4fb5781afbd40fa5267c99ad1d799acea6d6fa52 Mon Sep 17 00:00:00 2001 From: Joe Buck Date: Wed, 24 Jul 2013 12:24:33 -0700 Subject: [PATCH] teuth: fix issue in cleanup code The post-yield code in create_dirs needed to be tweaked to correctly delete the {tdir}/apache directory (if it exists) on each client. Signed-off-by: Joe Buck Reviewed-by: Josh Durgin --- teuthology/task/rgw.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index 35f5c63635a7d..b6921da67be65 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -49,11 +49,18 @@ def create_dirs(ctx, config): client=client), ], ) - ctx.cluster.only(client).run( - 'rmdir', - '{tdir}/apache.{client}'.format(tdir=testdir, - client=client), - ) + + for client in config.iterkeys(): + ctx.cluster.only(client).run( + args=[ + 'test', '-d', + '{tdir}/apache'.format(tdir=testdir), + run.Raw('&&'), + 'rmdir', + '{tdir}/apache'.format(tdir=testdir), + run.Raw(';'), + ], + ) @contextlib.contextmanager -- 2.39.5