]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_manager: count active+clean+<somjething else> as active+clean
authorSage Weil <sage@newdream.net>
Wed, 19 Oct 2011 17:04:07 +0000 (10:04 -0700)
committerSage Weil <sage@newdream.net>
Fri, 21 Oct 2011 17:54:05 +0000 (10:54 -0700)
In my case, one pg was active+clean+scrubbing.

Signed-off-by: Sage Weil <sage@newdream.net>
teuthology/task/ceph_manager.py

index ea81cc3e192ffbb3c58c2939128db5bd38d382c0..1f71b8b111059ce940b0873bf322a0c16a6c0a7b 100644 (file)
@@ -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()