From f10f86579684a0d1b8d99787b8e19709a64df7d6 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 28 Mar 2020 19:10:03 +0800 Subject: [PATCH] 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 --- qa/tasks/cephfs/mount.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index b48be1d2ddd..d3cb0a429ed 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -5,6 +5,7 @@ import logging import datetime import six import time +from six import StringIO from textwrap import dedent import os from teuthology.orchestra import run @@ -185,7 +186,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) @@ -198,8 +199,8 @@ class CephFSMount(object): args = args.split() args = ["cd", self.mountpoint, run.Raw('&&'), "sudo"] + args - return self.client_remote.run(args=args, stdout=BytesIO(), - stderr=BytesIO(), wait=wait, + return self.client_remote.run(args=args, stdout=StringIO(), + stderr=StringIO(), wait=wait, stdin=stdin, check_status=check_status, omit_sudo=omit_sudo) -- 2.39.5