From b8beff3dd55eb0a1ab57b66bd069f2cefe1e01dd Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 19 Oct 2011 10:04:07 -0700 Subject: [PATCH] ceph_manager: count active+clean+ as active+clean In my case, one pg was active+clean+scrubbing. Signed-off-by: Sage Weil --- teuthology/task/ceph_manager.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index ea81cc3e192ff..1f71b8b111059 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -209,15 +209,12 @@ class CephManager: return int(match.group(0).split('/')[0]) def get_num_active_clean(self): - status = self.raw_cluster_status() - self.log(status) - match = re.search( - "\d* active.clean", - status) - if match == None: - return 0 - else: - return int(match.group(0).split()[0]) + pgs = self.get_pg_stats() + num = 0 + for pg in pgs: + if pg['state'].startswith('active+clean'): + num += 1 + return num def get_num_active(self): pgs = self.get_pg_stats() -- 2.39.5