From: John Spray Date: Thu, 27 Feb 2014 14:22:02 +0000 (+0000) Subject: mds_thrash: Fix a potential getitem on None X-Git-Tag: 1.1.0~1634^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F211%2Fhead;p=teuthology.git mds_thrash: Fix a potential getitem on None 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 --- diff --git a/teuthology/task/mds_thrash.py b/teuthology/task/mds_thrash.py index 7b77d7943..c60b741a4 100644 --- a/teuthology/task/mds_thrash.py +++ b/teuthology/task/mds_thrash.py @@ -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']