import six
from io import BytesIO
+from six import StringIO
from teuthology import misc as teuthology
from tasks.scrub import Scrubber
from tasks.util.rados import cmd_erasure_code_profile
if watch_channel is not None:
args.append("--watch-channel")
args.append(watch_channel)
- return self.controller.run(args=args, wait=False, stdout=BytesIO(), stdin=run.PIPE)
+ return self.controller.run(args=args, wait=False, stdout=StringIO(), stdin=run.PIPE)
def get_mon_socks(self):
"""
def osd_admin_socket(self, osd_id, command, check_status=True, timeout=0, stdout=None):
if stdout is None:
- stdout = BytesIO()
+ stdout = StringIO()
return self.admin_socket('osd', osd_id, command, check_status, timeout, stdout)
def find_remote(self, service_type, service_id):
to the admin socket
"""
if stdout is None:
- stdout = BytesIO()
+ stdout = StringIO()
remote = self.find_remote(service_type, service_id)
five seconds and try again.
"""
if stdout is None:
- stdout = BytesIO()
+ stdout = StringIO()
tries = 0
while True:
proc = self.admin_socket(service_type, service_id,
"""
Ceph cluster task, deployed via cephadm orchestrator
"""
-from io import BytesIO
-
import argparse
import configobj
import contextlib
import re
import uuid
+from io import BytesIO
+from six import StringIO
from tarfile import ReadError
from tasks.ceph_manager import CephManager
from teuthology import misc as teuthology
run.Raw('|'), 'head', '-n', '1',
])
r = ctx.ceph[cluster_name].bootstrap_remote.run(
- stdout=BytesIO(),
+ stdout=StringIO(),
args=args,
)
stdout = r.stdout.getvalue()
remote=bootstrap_remote,
path='{}/seed.{}.conf'.format(testdir, cluster_name),
data=conf_fp.getvalue())
- log.debug('Final config:\n' + conf_fp.getvalue())
+ log.debug('Final config:\n' + conf_fp.getvalue().decode())
ctx.ceph[cluster_name].conf = seed_config
# register initial daemons
])
r = _shell(ctx, cluster_name, remote,
['ceph', 'orch', 'host', 'ls', '--format=json'],
- stdout=BytesIO())
+ stdout=StringIO())
hosts = [node['hostname'] for node in json.loads(r.stdout.getvalue())]
assert remote.shortname in hosts
args=[
'ceph', 'mon', 'dump', '-f', 'json',
],
- stdout=BytesIO(),
+ stdout=StringIO(),
)
j = json.loads(r.stdout.getvalue())
if len(j['mons']) == num_mons:
args=[
'ceph', 'config', 'generate-minimal-conf',
],
- stdout=BytesIO(),
+ stdout=StringIO(),
)
ctx.ceph[cluster_name].config_file = r.stdout.getvalue()
'mds', 'allow *',
'mgr', 'allow *',
],
- stdout=BytesIO(),
+ stdout=StringIO(),
)
keyring = r.stdout.getvalue()
teuthology.sudo_write_file(