]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds_thrash: Fix a potential getitem on None
authorJohn Spray <john.spray@inktank.com>
Thu, 27 Feb 2014 14:22:02 +0000 (14:22 +0000)
committerJohn Spray <john.spray@inktank.com>
Thu, 27 Feb 2014 18:39:45 +0000 (18:39 +0000)
get_mds_status returns None for things it can't see,
so have to check for Noneness on all its outputs.

Signed-off-by: John Spray <john.spray@inktank.com>
teuthology/task/mds_thrash.py

index 7b77d7943ed7c22d106a4b84d18647f81c8e9b7d..c60b741a49e12c936d77917c9264f58354ebda8f 100644 (file)
@@ -147,7 +147,7 @@ class MDSThrasher(Greenlet):
 
             # find the active mds in the failure group
             statuses = [self.manager.get_mds_status(m) for m in self.failure_group]
-            actives = filter(lambda s: s['state'] == 'up:active', statuses)
+            actives = filter(lambda s: s and s['state'] == 'up:active', statuses)
             assert len(actives) == 1, 'Can only have one active in a failure group'
 
             active_mds = actives[0]['name']