]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
ceph_manager: count 'incomplete' as 'down'
authorSage Weil <sage@inktank.com>
Sat, 28 Jul 2012 17:22:02 +0000 (10:22 -0700)
committerSage Weil <sage@inktank.com>
Sat, 28 Jul 2012 17:23:18 +0000 (10:23 -0700)
teuthology/task/ceph_manager.py

index 7896367321517465822018f6a88dac1282d00ee6..a099539b91b6b8cd8e9c02d254689eef87bcd26f 100644 (file)
@@ -266,12 +266,22 @@ class CephManager:
                 num += 1
         return num
 
+    def get_num_down(self):
+        pgs = self.get_pg_stats()
+        num = 0
+        for pg in pgs:
+            if (pg['state'].count('down') and not pg['state'].count('stale')) or \
+                    (pg['state'].count('incomplete') and not pg['state'].count('stale')):
+                num += 1
+        return num
+
     def get_num_active_down(self):
         pgs = self.get_pg_stats()
         num = 0
         for pg in pgs:
             if (pg['state'].count('active') and not pg['state'].count('stale')) or \
-                    (pg['state'].count('down') and not pg['state'].count('stale')):
+                    (pg['state'].count('down') and not pg['state'].count('stale')) or \
+                    (pg['state'].count('incomplete') and not pg['state'].count('stale')):
                 num += 1
         return num