]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tests: Fix mapped_role attribute where it gets overwritten for subsequent calls.
authorVasu Kulkarni <vasu@redhat.com>
Sat, 2 Dec 2017 23:20:47 +0000 (15:20 -0800)
committerVasu Kulkarni <vasu@redhat.com>
Fri, 8 Dec 2017 03:11:42 +0000 (19:11 -0800)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
qa/tasks/ceph_deploy.py

index 9b11f23bc99c924703e33633a955a6d301a54fb0..2e494f1707a1973a7af783400fc4c89c085a0942 100644 (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]