From: Kyr Shatskyy Date: Fri, 21 Feb 2020 18:18:43 +0000 (+0100) Subject: qa/tasks/ceph_deploy: get rid of cStringIO for py3 X-Git-Tag: v15.1.1~129^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F33709%2Fhead;p=ceph.git qa/tasks/ceph_deploy: get rid of cStringIO for py3 Signed-off-by: Kyr Shatskyy --- diff --git a/qa/tasks/ceph_deploy.py b/qa/tasks/ceph_deploy.py index 4b15b61dabe77..149607ca4ec47 100644 --- a/qa/tasks/ceph_deploy.py +++ b/qa/tasks/ceph_deploy.py @@ -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(