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: v16.1.0~2564^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34636%2Fhead;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 --- diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index 227d86e982a1..c4d785528391 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 [] @@ -447,14 +449,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)