ceph_manager: Thrasher fixes to run() calls to set check_status = False

Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
David Zafman 2014-10-23 21:49:03 -07:00 committed by Loic Dachary
parent 1903b7bee0
commit cf8bc063d5

View File

@ -141,7 +141,7 @@ class Thrasher:
allremotes = self.ceph_manager.ctx.cluster.only(teuthology.is_type('osd')).remotes.keys() allremotes = self.ceph_manager.ctx.cluster.only(teuthology.is_type('osd')).remotes.keys()
allremotes = list(set(allremotes)) allremotes = list(set(allremotes))
for remote in allremotes: for remote in allremotes:
proc = remote.run(args=['type', cmd], check_status=False, stdout=StringIO(), stderr=StringIO()) proc = remote.run(args=['type', cmd], wait=True, check_status=False, stdout=StringIO(), stderr=StringIO())
if proc.exitstatus != 0: if proc.exitstatus != 0:
return False; return False;
return True; return True;
@ -178,7 +178,7 @@ class Thrasher:
else: else:
prefix = "sudo ceph-objectstore-tool --data-path {fpath} --journal-path {jpath} --log-file=/var/log/ceph/objectstore_tool.\\$pid.log ".format(fpath=FSPATH, jpath=JPATH) prefix = "sudo ceph-objectstore-tool --data-path {fpath} --journal-path {jpath} --log-file=/var/log/ceph/objectstore_tool.\\$pid.log ".format(fpath=FSPATH, jpath=JPATH)
cmd = (prefix + "--op list-pgs").format(id=exp_osd) cmd = (prefix + "--op list-pgs").format(id=exp_osd)
proc = exp_remote.run(args=cmd, wait=True, check_status=True, stdout=StringIO()) proc = exp_remote.run(args=cmd, wait=True, check_status=False, stdout=StringIO())
if proc.exitstatus: if proc.exitstatus:
raise Exception("ceph-objectstore-tool: exp list-pgs failure with status {ret}".format(ret=proc.exitstatus)) raise Exception("ceph-objectstore-tool: exp list-pgs failure with status {ret}".format(ret=proc.exitstatus))
pgs = proc.stdout.getvalue().split('\n')[:-1] pgs = proc.stdout.getvalue().split('\n')[:-1]
@ -201,7 +201,7 @@ class Thrasher:
if exp_osd != imp_osd: if exp_osd != imp_osd:
# If pg isn't already on this osd, then we will move it there # If pg isn't already on this osd, then we will move it there
cmd = (prefix + "--op list-pgs").format(id=imp_osd) cmd = (prefix + "--op list-pgs").format(id=imp_osd)
proc = imp_remote.run(args=cmd, wait=True, check_status=True, stdout=StringIO()) proc = imp_remote.run(args=cmd, wait=True, check_status=False, stdout=StringIO())
if proc.exitstatus: if proc.exitstatus:
raise Exception("ceph-objectstore-tool: imp list-pgs failure with status {ret}".format(ret=proc.exitstatus)) raise Exception("ceph-objectstore-tool: imp list-pgs failure with status {ret}".format(ret=proc.exitstatus))
pgs = proc.stdout.getvalue().split('\n')[:-1] pgs = proc.stdout.getvalue().split('\n')[:-1]
@ -219,7 +219,7 @@ class Thrasher:
imp_remote = exp_remote imp_remote = exp_remote
# import # import
cmd = (prefix + "--op import --file {file}").format(id=imp_osd, file=exp_path) cmd = (prefix + "--op import --file {file}").format(id=imp_osd, file=exp_path)
imp_remote.run(args=cmd) proc = imp_remote.run(args=cmd, wait=True, check_status=False)
if proc.exitstatus: if proc.exitstatus:
raise Exception("ceph-objectstore-tool: import failure with status {ret}".format(ret=proc.exitstatus)) raise Exception("ceph-objectstore-tool: import failure with status {ret}".format(ret=proc.exitstatus))
cmd = "rm -f {file}".format(file=exp_path) cmd = "rm -f {file}".format(file=exp_path)
@ -243,7 +243,7 @@ class Thrasher:
else: else:
prefix = "sudo ceph-objectstore-tool --data-path {fpath} --journal-path {jpath} ".format(fpath=FSPATH, jpath=JPATH) prefix = "sudo ceph-objectstore-tool --data-path {fpath} --journal-path {jpath} ".format(fpath=FSPATH, jpath=JPATH)
cmd = (prefix + "--op list-pgs").format(id=osd) cmd = (prefix + "--op list-pgs").format(id=osd)
proc = remote.run(args=cmd, wait=True, check_status=True, stdout=StringIO()) proc = remote.run(args=cmd, wait=True, check_status=False, stdout=StringIO())
if proc.exitstatus: if proc.exitstatus:
raise Exception("ceph_objectstore_tool: exp list-pgs failure with status {ret}".format(ret=proc.exitstatus)) raise Exception("ceph_objectstore_tool: exp list-pgs failure with status {ret}".format(ret=proc.exitstatus))
pgs = proc.stdout.getvalue().split('\n')[:-1] pgs = proc.stdout.getvalue().split('\n')[:-1]