From 8dfcfa4a7e926d460dbbc16ecdbfb4259e59d50d Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 27 Feb 2014 14:22:02 +0000 Subject: [PATCH] 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 --- teuthology/task/mds_thrash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'] -- 2.47.3