Skip to content

Commit

Permalink
qa/tests: Fix mapped_role attribute where it gets overwritten for sub…
Browse files Browse the repository at this point in the history
…sequent calls.

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
  • Loading branch information
vasukulkarni committed Dec 4, 2017
1 parent dd9e35b commit bf7ef94
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions qa/tasks/ceph_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -727,6 +732,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]
Expand Down

0 comments on commit bf7ef94

Please sign in to comment.