Skip to content

Commit

Permalink
tests: fix regression in qa/tasks/ceph_master.py
Browse files Browse the repository at this point in the history
ceph#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 <ncutler@suse.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit db2582e)
  • Loading branch information
smithfarm committed Feb 7, 2017
1 parent 9620088 commit c968ed3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions qa/tasks/ceph_manager.py
Expand Up @@ -298,12 +298,13 @@ def kill_osd(self, osd=None, mark_down=False, mark_out=False):
# 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")
Expand Down

0 comments on commit c968ed3

Please sign in to comment.