From c968ed34b100baeb3a6a3245ad39c2a2d6fab04e Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Mon, 6 Feb 2017 18:43:49 +0100 Subject: [PATCH] tests: fix regression in qa/tasks/ceph_master.py https://github.com/ceph/ceph/pull/13194 introduced a regression: 2017-02-06T16:14:23.162 INFO:tasks.thrashosds.thrasher:Traceback (most recent call last): File "/home/teuthworker/src/github.com_ceph_ceph_master/qa/tasks/ceph_manager.py", line 722, in wrapper return func(self) File "/home/teuthworker/src/github.com_ceph_ceph_master/qa/tasks/ceph_manager.py", line 839, in do_thrash self.choose_action()() File "/home/teuthworker/src/github.com_ceph_ceph_master/qa/tasks/ceph_manager.py", line 305, in kill_osd output = proc.stderr.getvalue() AttributeError: 'NoneType' object has no attribute 'getvalue' This is because the original patch failed to pass "stderr=StringIO()" to run(). Fixes: http://tracker.ceph.com/issues/16263 Signed-off-by: Nathan Cutler Signed-off-by: Kefu Chai (cherry picked from commit db2582e25e390fcaf75952eb59a73dcff643f49c) --- qa/tasks/ceph_manager.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index d0e6a27765e6d..11bc824d9dd7c 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -298,12 +298,13 @@ class Thrasher: # import cmd = (prefix + "--op import --file {file}") cmd = cmd.format(id=imp_osd, file=exp_path) - proc = imp_remote.run(args=cmd, wait=True, check_status=False) - output = proc.stderr.getvalue() - bogosity = "The OSD you are using is older than the exported PG" - if proc.exitstatus == 1 and bogosity in output: - self.log("OSD older than exported PG" - "...ignored") + proc = imp_remote.run(args=cmd, wait=True, check_status=False, + stderr=StringIO()) + if proc.exitstatus == 1: + bogosity = "The OSD you are using is older than the exported PG" + if bogosity in proc.stderr.getvalue(): + self.log("OSD older than exported PG" + "...ignored") elif proc.exitstatus == 10: self.log("Pool went away before processing an import" "...ignored") -- 2.39.5