From 982ba399b34765ca888dafbbf4221bab53e7964a Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Fri, 21 Feb 2020 19:18:43 +0100 Subject: [PATCH] qa/tasks/ceph_deploy: get rid of cStringIO for py3 Signed-off-by: Kyr Shatskyy --- qa/tasks/ceph_deploy.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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( -- 2.39.5