]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_deploy: get rid of cStringIO for py3 33709/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 21 Feb 2020 18:18:43 +0000 (19:18 +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/ceph_deploy.py

index 4b15b61dabe77aa22259516d830a75017f59d0dd..149607ca4ec4732693fd403c08e47540b35d4a14 100644 (file)
@@ -1,7 +1,6 @@
 """
 Execute ceph-deploy as a task
 """
-from cStringIO import StringIO
 
 import contextlib
 import os
@@ -116,18 +115,16 @@ def is_healthy(ctx, config):
             )
             raise RuntimeError(msg)
 
-        r = remote.run(
-            args=[
+        out = remote.sh(
+            [
                 'cd',
                 '{tdir}'.format(tdir=testdir),
                 run.Raw('&&'),
                 'sudo', 'ceph',
                 'health',
             ],
-            stdout=StringIO(),
             logger=log.getChild('health'),
         )
-        out = r.stdout.getvalue()
         log.info('Ceph health: %s', out.rstrip('\n'))
         if out.split(None, 1)[0] == 'HEALTH_OK':
             break
@@ -678,15 +675,13 @@ def cli_test(ctx, config):
     log.info("list files for debugging purpose to check file permissions")
     admin.run(args=['ls', run.Raw('-lt'), conf_dir])
     remote.run(args=['sudo', 'ceph', '-s'], check_status=False)
-    r = remote.run(args=['sudo', 'ceph', 'health'], stdout=StringIO())
-    out = r.stdout.getvalue()
+    out = remote.sh('sudo ceph health')
     log.info('Ceph health: %s', out.rstrip('\n'))
     log.info("Waiting for cluster to become healthy")
     with contextutil.safe_while(sleep=10, tries=6,
                                 action='check health') as proceed:
         while proceed():
-            r = remote.run(args=['sudo', 'ceph', 'health'], stdout=StringIO())
-            out = r.stdout.getvalue()
+            out = remote.sh('sudo ceph health')
             if (out.split(None, 1)[0] == 'HEALTH_OK'):
                 break
     rgw_install = 'install {branch} --rgw {node}'.format(