From: Kyr Shatskyy Date: Mon, 16 Dec 2019 01:46:13 +0000 (+0100) Subject: qa/tasks/cephfs/kernel_mount: get rid of StringIO.StringIO for py3 X-Git-Tag: v16.0.0~52^2~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=875b45f3c903781ba99dbd2fcf4d2fc89001c25b;p=ceph-ci.git qa/tasks/cephfs/kernel_mount: get rid of StringIO.StringIO for py3 Signed-off-by: Kyr Shatskyy --- diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 86a06006df7..769edd975f1 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -1,4 +1,3 @@ -from StringIO import StringIO import json import logging import time @@ -211,10 +210,10 @@ class KernelMount(CephFSMount): print(json.dumps(get_id_to_dir())) """) - p = self.client_remote.run(args=[ + output = self.client_remote.sh([ 'sudo', 'python3', '-c', pyscript - ], stdout=StringIO(), timeout=(5*60)) - client_id_to_dir = json.loads(p.stdout.getvalue()) + ], timeout=(5*60)) + client_id_to_dir = json.loads(output) try: return client_id_to_dir[self.client_id] @@ -233,10 +232,10 @@ class KernelMount(CephFSMount): print(open(os.path.join("{debug_dir}", "{filename}")).read()) """).format(debug_dir=debug_dir, filename=filename) - p = self.client_remote.run(args=[ + output = self.client_remote.sh([ 'sudo', 'python3', '-c', pyscript - ], stdout=StringIO(), timeout=(5*60)) - return p.stdout.getvalue() + ], timeout=(5*60)) + return output def get_global_id(self): """