import threading
import traceback
import os
+import six
from io import BytesIO
from teuthology import misc as teuthology
from teuthology.orchestra import run
from teuthology.exceptions import CommandFailedError
from tasks.thrasher import Thrasher
-import six
+from six import StringIO
try:
from subprocess import DEVNULL # py3k
args=['ceph-objectstore-tool'] + cmd,
name=osd,
wait=True, check_status=False,
- stdout=BytesIO(),
- stderr=BytesIO())
+ stdout=StringIO(),
+ stderr=StringIO())
else:
return remote.run(
args=['sudo', 'adjust-ulimits', 'ceph-objectstore-tool'] + cmd,
- wait=True, check_status=False, stdout=BytesIO(),
- stderr=BytesIO())
+ wait=True, check_status=False,
+ stdout=StringIO(),
+ stderr=StringIO())
def kill_osd(self, osd=None, mark_down=False, mark_out=False):
"""
if proc.exitstatus == 0:
break
elif (proc.exitstatus == 1 and
- six.ensure_str(proc.stderr.getvalue()) == "OSD has the store locked"):
+ proc.stderr.getvalue() == "OSD has the store locked"):
continue
else:
raise Exception("ceph-objectstore-tool: "
])
if proc.exitstatus == 1:
bogosity = "The OSD you are using is older than the exported PG"
- if bogosity in six.ensure_str(proc.stderr.getvalue()):
+ if bogosity in proc.stderr.getvalue():
self.log("OSD older than exported PG"
"...ignored")
elif proc.exitstatus == 10:
+ " --op apply-layout-settings --pool " + pool).format(id=osd)
proc = imp_remote.run(args=cmd,
wait=True, check_status=False,
- stderr=BytesIO)
- if 'Couldn\'t find pool' in six.ensure_str(proc.stderr.getvalue()):
+ stderr=StringIO())
+ if 'Couldn\'t find pool' in proc.stderr.getvalue():
continue
if proc.exitstatus:
raise Exception("ceph-objectstore-tool apply-layout-settings"