]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: Add roleless mon names to ctx.cluster.remotes role dict
authorVarsha Rao <varao@redhat.com>
Wed, 13 May 2020 07:31:34 +0000 (07:31 +0000)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 2 Jun 2020 12:58:27 +0000 (14:58 +0200)
Fixes: https://tracker.ceph.com/issues/45584
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 58eaeb53e4c7f0b5ed1131778304f72264f20e46)

qa/tasks/cephadm.py

index 82511971ee2f777be664c7093d470c6f2b370940..57efb1ab49293c0773531f0d9c15c48df22d756b 100644 (file)
@@ -1007,20 +1007,20 @@ def initialize_config(ctx, config):
     # mon ips
     log.info('Choosing monitor IPs and ports...')
     remotes_and_roles = ctx.cluster.remotes.items()
-    roles = [role_list for (remote, role_list) in remotes_and_roles]
     ips = [host for (host, port) in
            (remote.ssh.get_transport().getpeername() for (remote, role_list) in remotes_and_roles)]
 
     if config.get('roleless', False):
         # mons will be named after hosts
-        roles = []
         first_mon = None
         for remote, _ in remotes_and_roles:
-            roles.append(['mon.' + remote.shortname])
+            ctx.cluster.remotes[remote].append('mon.' + remote.shortname)
             if not first_mon:
                 first_mon = remote.shortname
                 bootstrap_remote = remote
-        log.info('No roles; fabricating mons %s' % roles)
+        log.info('No mon roles; fabricating mons')
+
+    roles = [role_list for (remote, role_list) in ctx.cluster.remotes.items()]
 
     ctx.ceph[cluster_name].mons = get_mons(
         roles, ips, cluster_name,