From: Kefu Chai Date: Sat, 28 Mar 2020 11:10:03 +0000 (+0800) Subject: qa/tasks/cephfs: use StringIO for capturing str X-Git-Tag: v15.2.4~42^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ebc470dfa0cc18556582db075097b6270963f13;p=ceph.git qa/tasks/cephfs: use StringIO for capturing str if we don't expect non-utf8 in stdout, use StringIO instead of BytesIO. see also d8d44ed1566b19eec055e07da2a0fed88fed4152 Signed-off-by: Kefu Chai (cherry picked from commit f10f86579684a0d1b8d99787b8e19709a64df7d6) --- diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index 39c5add1363a..421d0c5c73b4 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -4,6 +4,7 @@ import logging import datetime import six import time +from six import StringIO from textwrap import dedent import os from teuthology.orchestra import run @@ -184,7 +185,7 @@ class CephFSMount(object): return self.client_remote.run( args=['sudo', 'adjust-ulimits', 'daemon-helper', 'kill', py_version, '-c', pyscript], wait=False, stdin=run.PIPE, - stdout=BytesIO()) + stdout=StringIO()) def run_python(self, pyscript, py_version='python3'): p = self._run_python(pyscript, py_version)