]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: allow mounting volumes in shell
authorSage Weil <sage@newdream.net>
Sun, 2 May 2021 22:08:52 +0000 (18:08 -0400)
committerSage Weil <sage@newdream.net>
Thu, 3 Jun 2021 12:37:42 +0000 (07:37 -0500)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit b711a752775bb21bafa2ec376346eb7cd99f5c18)

qa/tasks/cephadm.py

index dcc3feb405bb8483e8d8519e48b3bed1cfe0a89c..57ede18136cf46ce7e0818c6773c6ae6e2db0fd5 100644 (file)
@@ -1009,11 +1009,11 @@ def shell(ctx, config):
     """
     cluster_name = config.get('cluster', 'ceph')
 
-    env = []
-    if 'env' in config:
-        for k in config['env']:
-            env.extend(['-e', k + '=' + ctx.config.get(k, '')])
-        del config['env']
+    args = []
+    for k in config.pop('env', []):
+        args.extend(['-e', k + '=' + ctx.config.get(k, '')])
+    for k in config.pop('volumes', []):
+        args.extend(['-v', k])
 
     if 'all-roles' in config and len(config) == 1:
         a = config['all-roles']
@@ -1031,12 +1031,12 @@ def shell(ctx, config):
             for c in cmd:
                 _shell(ctx, cluster_name, remote,
                        ['bash', '-c', subst_vip(ctx, c)],
-                       extra_cephadm_args=env)
+                       extra_cephadm_args=args)
         else:
             assert isinstance(cmd, str)
             _shell(ctx, cluster_name, remote,
                    ['bash', '-ex', '-c', subst_vip(ctx, cmd)],
-                   extra_cephadm_args=env)
+                   extra_cephadm_args=args)
 
 
 def apply(ctx, config):