]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: let cephadm.shell take string or list
authorSage Weil <sage@newdream.net>
Mon, 12 Apr 2021 20:12:01 +0000 (16:12 -0400)
committerSage Weil <sage@newdream.net>
Fri, 16 Apr 2021 12:36:47 +0000 (07:36 -0500)
Make it a bit more forgiving.

Signed-off-by: Sage Weil <sage@newdream.net>
qa/tasks/cephadm.py

index 01d49a7f3acbe772ffbaaa622f03f518c48ea27c..033a41e23e2bc00bf6722715ae585eea238764fb 100644 (file)
@@ -948,14 +948,21 @@ def shell(ctx, config):
         roles = teuthology.all_roles(ctx.cluster)
         config = dict((id_, a) for id_ in roles)
 
-    for role, ls in config.items():
+    for role, cmd in config.items():
         (remote,) = ctx.cluster.only(role).remotes.keys()
         log.info('Running commands on role %s host %s', role, remote.name)
-        for c in ls:
+        if isinstance(cmd, list):
+            for c in cmd:
+                _shell(ctx, cluster_name, remote,
+                       ['bash', '-c', c],
+                       extra_cephadm_args=env)
+        else:
+            assert isinstance(cmd, str)
             _shell(ctx, cluster_name, remote,
-                   ['bash', '-c', c],
+                   ['bash', '-ex', '-c', cmd],
                    extra_cephadm_args=env)
 
+
 def apply(ctx, config):
     """
     Apply spec