From: Xiubo Li Date: Thu, 23 Apr 2020 11:39:31 +0000 (-0400) Subject: qa/tasks/vstart_runner: remove the stdin str type check X-Git-Tag: v16.1.0~2502^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf10478294e26dc785dd79b0367bf096e9f67b42;p=ceph.git qa/tasks/vstart_runner: remove the stdin str type check For the "ceph-dencoder" it will use the byte type data. Signed-off-by: Xiubo Li --- diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 1398fb5060e4..60877ed63a4f 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -1094,7 +1094,7 @@ class Filesystem(MDSCluster): os.path.join(self._prefix, "rados"), "-p", pool, "getxattr", obj_name, xattr_name ] try: - proc = remote.run(args=args, stdout=StringIO()) + proc = remote.run(args=args, stdout=BytesIO()) except CommandFailedError as e: log.error(e.__str__()) raise ObjectNotFound(obj_name) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index d6a69066255e..6e4403c6ef5b 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -390,12 +390,12 @@ class LocalRemote(object): env=env) if stdin: - if not isinstance(stdin, str): - raise RuntimeError("Can't handle non-string stdins on a vstart cluster") - # Hack: writing to stdin is not deadlock-safe, but it "always" works # as long as the input buffer is "small" - subproc.stdin.write(stdin.encode()) + if isinstance(stdin, str): + subproc.stdin.write(stdin.encode()) + else: + subproc.stdin.write(stdin) proc = LocalRemoteProcess( args, subproc, check_status,