From: Kefu Chai Date: Mon, 20 Apr 2020 11:50:02 +0000 (+0800) Subject: qa/tasks/cephfs/fuse_mount.py: by python3 compatible X-Git-Tag: v14.2.10~17^2~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72a59f1c55f6820aefb5983d7e160673ecc6941d;p=ceph.git qa/tasks/cephfs/fuse_mount.py: by python3 compatible pass `StringIO()` to capture stdout whose value will be interpreted as a string later on Signed-off-by: Kefu Chai (cherry picked from commit c5bd318de65866b4992314c2fb0e82090b4d2979) --- diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index 61d28e38ee52..28e892b9d5d0 100644 --- a/qa/tasks/cephfs/fuse_mount.py +++ b/qa/tasks/cephfs/fuse_mount.py @@ -1,4 +1,5 @@ from io import BytesIO +from io import StringIO import json import time import logging @@ -101,6 +102,7 @@ class FuseMount(CephFSMount): ) try: ls_str = self.client_remote.sh("ls /sys/fs/fuse/connections", + stdout=StringIO(), timeout=(15*60)).strip() except CommandFailedError: return [] @@ -433,14 +435,16 @@ print(find_socket("{client_name}")) client_name="client.{0}".format(self.client_id)) # Find the admin socket - asok_path = self.client_remote.sh([ - 'sudo', 'python3', '-c', pyscript - ], timeout=(15*60)).strip() + asok_path = self.client_remote.sh( + ['sudo', 'python3', '-c', pyscript], + stdout=StringIO(), + timeout=(15*60)).strip() log.info("Found client admin socket at {0}".format(asok_path)) # Query client ID from admin socket json_data = self.client_remote.sh( ['sudo', self._prefix + 'ceph', '--admin-daemon', asok_path] + args, + stdout=StringIO(), timeout=(15*60)) return json.loads(json_data)