1
0
mirror of https://github.com/ceph/ceph synced 2025-03-30 23:40:09 +00:00

qa/tests: Fix mapped_role attribute where it gets overwritten for subsequent calls.

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
This commit is contained in:
Vasu Kulkarni 2017-12-02 15:20:47 -08:00
parent 67ff2de694
commit 9430f352f4

View File

@ -166,8 +166,13 @@ def get_nodes_using_role(ctx, target_role):
modified_remotes[_remote].append(svc_id)
ctx.cluster.remotes = modified_remotes
ctx.cluster.mapped_role = ceph_deploy_mapped
# since the function is called multiple times for target roles
# append new mapped roles
if not hasattr(ctx.cluster, 'mapped_role'):
ctx.cluster.mapped_role = ceph_deploy_mapped
else:
ctx.cluster.mapped_role.update(ceph_deploy_mapped)
log.info("New mapped_role={mr}".format(mr=ctx.cluster.mapped_role))
return nodes_of_interest
@ -781,6 +786,7 @@ def upgrade(ctx, config):
# get the roles that are mapped as per ceph-deploy
# roles are mapped for mon/mds eg: mon.a => mon.host_short_name
mapped_role = ctx.cluster.mapped_role
log.info("roles={r}, mapped_roles={mr}".format(r=roles, mr=mapped_role))
if config.get('branch'):
branch = config.get('branch')
(var, val) = branch.items()[0]