From: Kefu Chai Date: Tue, 7 Apr 2020 16:45:49 +0000 (+0800) Subject: qa/tasks/ceph_manager.py: do not return a filter X-Git-Tag: v14.2.10~17^2~47 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14a08e7f603fcba3c14075a83f1a3afbb59ffe6a;p=ceph.git qa/tasks/ceph_manager.py: do not return a filter as the caller might want to `len(manager.get_osd_status()['raw'])`, and `len()` does not accept a `filter` object. also, the filtered osd statuses are printed out using `self.log()`, so we should materialize the `filter` object before sending it to logging facility. otherwise we will have something like: ``` 2020-04-08T02:58:37.001 INFO:tasks.ceph.ceph_manager.ceph: ``` in the logging message. Signed-off-by: Kefu Chai (cherry picked from commit 6bc09c5041d025c7ed3638ccfbf6496e1626abfb) --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 6b1a89be35be..211a46fec114 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -1552,9 +1552,9 @@ class CephManager: """ Get osd statuses sorted by states that the osds are in. """ - osd_lines = filter( + osd_lines = list(filter( lambda x: x.startswith('osd.') and (("up" in x) or ("down" in x)), - self.raw_osd_status().split('\n')) + self.raw_osd_status().split('\n'))) self.log(osd_lines) in_osds = [int(i[4:].split()[0]) for i in filter(lambda x: " in " in x, osd_lines)]