From f2438e8c80c8623a1336ce5a2b219a869685f3ce Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 15 Mar 2016 14:57:45 -0700 Subject: [PATCH] misc: convert num_instances_of_type() to use is_type() Signed-off-by: Josh Durgin --- teuthology/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 185f53b51d..326427f5cb 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -442,8 +442,8 @@ def num_instances_of_type(cluster, type_): """ remotes_and_roles = cluster.remotes.items() roles = [roles for (remote, roles) in remotes_and_roles] - prefix = '{type}.'.format(type=type_) - num = sum(sum(1 for role in hostroles if role.startswith(prefix)) + is_ceph_type = is_type(type_) + num = sum(sum(1 for role in hostroles if is_ceph_type(role)) for hostroles in roles) return num -- 2.39.5