From: Kyr Shatskyy Date: Sat, 15 Feb 2020 11:12:27 +0000 (+0100) Subject: qa/tasks/cephadm: get rid of cStringIO for py3 X-Git-Tag: v15.1.1~129^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=145ba3e1009937282ffdd43f33ced601d1287ddc;p=ceph.git qa/tasks/cephadm: get rid of cStringIO for py3 Signed-off-by: Kyr Shatskyy --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 2bf39421c624..12f65bd0ca66 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -1,7 +1,7 @@ """ Ceph cluster task, deployed via cephadm orchestrator """ -from cStringIO import StringIO +from io import BytesIO import argparse import configobj @@ -189,7 +189,7 @@ def ceph_log(ctx, config): run.Raw('|'), 'head', '-n', '1', ]) r = ctx.ceph[cluster_name].bootstrap_remote.run( - stdout=StringIO(), + stdout=BytesIO(), args=args, ) stdout = r.stdout.getvalue() @@ -313,7 +313,7 @@ def ceph_bootstrap(ctx, config): try: # write seed config log.info('Writing seed config...') - conf_fp = StringIO() + conf_fp = BytesIO() seed_config = build_initial_config(ctx, config) seed_config.write(conf_fp) teuthology.write_file( @@ -423,7 +423,7 @@ def ceph_bootstrap(ctx, config): ]) r = _shell(ctx, cluster_name, remote, ['ceph', 'orch', 'host', 'ls', '--format=json'], - stdout=StringIO()) + stdout=BytesIO()) hosts = [node['hostname'] for node in json.loads(r.stdout.getvalue())] assert remote.shortname in hosts @@ -490,7 +490,7 @@ def ceph_mons(ctx, config): args=[ 'ceph', 'mon', 'dump', '-f', 'json', ], - stdout=StringIO(), + stdout=BytesIO(), ) j = json.loads(r.stdout.getvalue()) if len(j['mons']) == num_mons: @@ -748,7 +748,7 @@ def ceph_clients(ctx, config): 'mds', 'allow *', 'mgr', 'allow *', ], - stdout=StringIO(), + stdout=BytesIO(), ) keyring = r.stdout.getvalue() teuthology.sudo_write_file(