From 9430f352f445325c4d88fc316a9ff24e4dafcab6 Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Sat, 2 Dec 2017 15:20:47 -0800 Subject: [PATCH] qa/tests: Fix mapped_role attribute where it gets overwritten for subsequent calls. Signed-off-by: Vasu Kulkarni --- qa/tasks/ceph_deploy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qa/tasks/ceph_deploy.py b/qa/tasks/ceph_deploy.py index 9b11f23bc99..2e494f1707a 100644 --- a/qa/tasks/ceph_deploy.py +++ b/qa/tasks/ceph_deploy.py @@ -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] -- 2.39.5