]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/rbd: cleanup passphrase file 39086/head
authorOr Ozeri <oro@il.ibm.com>
Tue, 26 Jan 2021 15:02:37 +0000 (17:02 +0200)
committerOr Ozeri <oro@il.ibm.com>
Tue, 26 Jan 2021 15:02:37 +0000 (17:02 +0200)
This commit adds a cleanup for the passphrase file used to create/mount encrypted rbd images.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
qa/tasks/rbd.py

index 81544bf8aca0e5fd75c936bc62715babc3a84168..46c55c6ad2b2f9adb0b4dd03d92bcc13f33a5450 100644 (file)
@@ -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