From 1cd6e8bf6c603f1f0e4682c07cc46407b3ea6644 Mon Sep 17 00:00:00 2001 From: Or Ozeri Date: Tue, 26 Jan 2021 17:02:37 +0200 Subject: [PATCH] qa/tasks/rbd: cleanup passphrase file This commit adds a cleanup for the passphrase file used to create/mount encrypted rbd images. Signed-off-by: Or Ozeri (cherry picked from commit 8498da2aca43c96e0d54aa688fc2b80002083149) --- qa/tasks/rbd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/tasks/rbd.py b/qa/tasks/rbd.py index 81544bf8aca0e..46c55c6ad2b2f 100644 --- a/qa/tasks/rbd.py +++ b/qa/tasks/rbd.py @@ -56,6 +56,7 @@ def create_image(ctx, config): images = [(role, None) for role in config] testdir = teuthology.get_testdir(ctx) + passphrase_file = '{tdir}/passphrase'.format(tdir=testdir) for role, properties in images: if properties is None: properties = {} @@ -83,7 +84,6 @@ def create_image(ctx, config): remote.run(args=args) if encryption_format != 'none': - passphrase_file = '{tdir}/passphrase'.format(tdir=testdir) remote.run( args=[ 'echo', @@ -111,6 +111,7 @@ def create_image(ctx, config): yield finally: log.info('Deleting rbd images...') + remote.run(args=['rm', '-f', passphrase_file]) for role, properties in images: if properties is None: properties = {} @@ -327,6 +328,7 @@ def dev_create(ctx, config): yield finally: log.info('Unmapping rbd devices...') + remote.run(args=['rm', '-f', passphrase_file]) for role, properties in role_images: if not device_path.get(role): continue -- 2.39.5