]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/ceph: make wait_for_mon_quorum cluster-aware
authorJosh Durgin <jdurgin@redhat.com>
Fri, 25 Mar 2016 03:23:36 +0000 (20:23 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Fri, 20 May 2016 18:08:54 +0000 (11:08 -0700)
Accept a 'daemons' list like other ceph subtasks, so it can get an
optional 'cluster' setting too.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
(cherry picked from commit 9ad65769c77586332d81c9a7414b2f8d90e391b7)

tasks/ceph.py

index 92ebdbe1611c29f846308013556be867b9d766c3..449208edcabef1de8d2c66d14ffcadac3a79a00c 100644 (file)
@@ -1144,9 +1144,14 @@ def wait_for_mon_quorum(ctx, config):
     :param ctx: Context
     :param config: Configuration
     """
-
-    assert isinstance(config, list)
-    firstmon = teuthology.get_first_mon(ctx, config)
+    if isinstance(config, dict):
+        mons = config['daemons']
+        cluster_name = config.get('cluster', 'ceph')
+    else:
+        assert isinstance(config, list)
+        mons = config
+        cluster_name = 'ceph'
+    firstmon = teuthology.get_first_mon(ctx, config, cluster_name)
     (remote,) = ctx.cluster.only(firstmon).remotes.keys()
     while True:
         r = remote.run(
@@ -1161,7 +1166,7 @@ def wait_for_mon_quorum(ctx, config):
         j = json.loads(r.stdout.getvalue())
         q = j.get('quorum_names', [])
         log.debug('Quorum: %s', q)
-        if sorted(q) == sorted(config):
+        if sorted(q) == sorted(mons):
             break
         time.sleep(1)