]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: get rid of cStringIO for py3
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Sat, 15 Feb 2020 11:12:27 +0000 (12:12 +0100)
committerKefu Chai <kchai@redhat.com>
Wed, 4 Mar 2020 05:09:17 +0000 (13:09 +0800)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
qa/tasks/cephadm.py

index 2bf39421c6249577119f54416e099cb6d76da502..12f65bd0ca664186377481ebad6080819df78916 100644 (file)
@@ -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(