From 45b6189b7da91c30ef746ee41ed5a7e54578ad8e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 18 Feb 2012 14:44:53 -0800 Subject: [PATCH] ceph_manager: ignore stale states when counting also remove assumptions about ordering of states --- teuthology/task/ceph_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index b946b49295de1..1fac70380085e 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -222,7 +222,7 @@ class CephManager: pgs = self.get_pg_stats() num = 0 for pg in pgs: - if pg['state'].startswith('active+clean'): + if pg['state'].count('active') and pg['state'].count('clean') and not pg['state'].count('stale'): num += 1 return num @@ -230,7 +230,7 @@ class CephManager: pgs = self.get_pg_stats() num = 0 for pg in pgs: - if pg['state'].count('active') and not pg['state'].count('recovering'): + if pg['state'].count('active') and not pg['state'].count('recovering') and not pg['state'].count('stale'): num += 1 return num @@ -238,7 +238,7 @@ class CephManager: pgs = self.get_pg_stats() num = 0 for pg in pgs: - if pg['state'].startswith('active'): + if pg['state'].count('active') and not pg['state'].count('stale'): num += 1 return num -- 2.39.5