]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
misc: add cluster filter to num_instances_of_type
authorJosh Durgin <jdurgin@redhat.com>
Thu, 17 Mar 2016 01:20:07 +0000 (18:20 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Mon, 11 Apr 2016 21:36:42 +0000 (14:36 -0700)
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
teuthology/misc.py

index 9c9e33787dbeda62b36e703f1197a8a4b5ff5f2f..1d8275548bd9cf76be4a16b280cd9e3bd6dc385f 100644 (file)
@@ -445,16 +445,17 @@ def is_type(type_, cluster=None):
     return _is_type
 
 
-def num_instances_of_type(cluster, type_):
+def num_instances_of_type(cluster, type_, ceph_cluster='ceph'):
     """
     Total the number of instances of the role type specified in all remotes.
 
     :param cluster: Cluster extracted from ctx.
     :param type_: role
+    :param ceph_cluster: filter for ceph cluster name
     """
     remotes_and_roles = cluster.remotes.items()
     roles = [roles for (remote, roles) in remotes_and_roles]
-    is_ceph_type = is_type(type_)
+    is_ceph_type = is_type(type_, ceph_cluster)
     num = sum(sum(1 for role in hostroles if is_ceph_type(role))
               for hostroles in roles)
     return num