]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: use StringIO for capturing str
authorKefu Chai <kchai@redhat.com>
Sat, 28 Mar 2020 11:10:03 +0000 (19:10 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 12:33:47 +0000 (20:33 +0800)
if we don't expect non-utf8 in stdout, use StringIO instead of BytesIO.

see also d8d44ed1566b19eec055e07da2a0fed88fed4152

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/cephfs/mount.py

index b48be1d2dddd20e3dbd68e945f2bcc25ba2da26d..d3cb0a429edd3fb0cdda33b961ab9015eb15a240 100644 (file)
@@ -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)