]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
misc: add cluster param to skeleton_config
authorJosh Durgin <jdurgin@redhat.com>
Thu, 17 Mar 2016 00:57:47 +0000 (17:57 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Mon, 11 Apr 2016 21:36:42 +0000 (14:36 -0700)
We need to consider all monitors to allocate unique ips in get_mons(),
but generate the conf file per-cluster.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
teuthology/misc.py

index ccf78009ea4d2218f21911df050db393695214df..6f34f115fc48e4f2fb2cff283933f75960fd1406 100644 (file)
@@ -319,7 +319,7 @@ def generate_caps(type_):
         yield capability
 
 
-def skeleton_config(ctx, roles, ips):
+def skeleton_config(ctx, roles, ips, cluster='ceph'):
     """
     Returns a ConfigObj that is prefilled with a skeleton config.
 
@@ -333,6 +333,9 @@ def skeleton_config(ctx, roles, ips):
     conf = configobj.ConfigObj(StringIO(skconf), file_error=True)
     mons = get_mons(roles=roles, ips=ips)
     for role, addr in mons.iteritems():
+        mon_cluster, _, _ = split_role(role)
+        if mon_cluster != cluster:
+            continue
         name = ceph_role(role)
         conf.setdefault(name, {})
         conf[name]['mon addr'] = addr