Skip to content

Commit

Permalink
qa/tasks: replace uses of subst_vip with new templating function
Browse files Browse the repository at this point in the history
Signed-off-by: John Mulligan <jmulligan@redhat.com>
  • Loading branch information
phlogistonjohn committed Feb 29, 2024
1 parent 7bd85b5 commit 4f1f095
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions qa/tasks/cephadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

# these items we use from ceph.py should probably eventually move elsewhere
from tasks.ceph import get_mons, healthy
from tasks.vip import subst_vip

CEPH_ROLE_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rgw', 'prometheus']

Expand Down Expand Up @@ -1415,18 +1414,19 @@ def shell(ctx, config):
roles = teuthology.all_roles(ctx.cluster)
config = dict((id_, a) for id_ in roles if id_.startswith('host.'))

config = _template_transform(ctx, config, config)
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)
if isinstance(cmd, list):
for c in cmd:
_shell(ctx, cluster_name, remote,
['bash', '-c', subst_vip(ctx, c)],
['bash', '-c', c],
extra_cephadm_args=args)
else:
assert isinstance(cmd, str)
_shell(ctx, cluster_name, remote,
['bash', '-ex', '-c', subst_vip(ctx, cmd)],
['bash', '-ex', '-c', cmd],
extra_cephadm_args=args)


Expand All @@ -1452,7 +1452,8 @@ def apply(ctx, config):
cluster_name = config.get('cluster', 'ceph')

specs = config.get('specs', [])
y = subst_vip(ctx, yaml.dump_all(specs))
specs = _template_transform(ctx, config, specs)
y = yaml.dump_all(specs)

log.info(f'Applying spec(s):\n{y}')
_shell(
Expand Down

0 comments on commit 4f1f095

Please sign in to comment.