From: Sage Weil Date: Mon, 12 Apr 2021 20:12:01 +0000 (-0400) Subject: qa/tasks/cephadm: let cephadm.shell take string or list X-Git-Tag: v16.2.2~1^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4f92de90769c5140d04cf4d0afb039823870083;p=ceph.git qa/tasks/cephadm: let cephadm.shell take string or list Make it a bit more forgiving. Signed-off-by: Sage Weil (cherry picked from commit 779af3da6fd6405e13a2e522c57fa1d1512595a9) --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 01d49a7f3acb..033a41e23e2b 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -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