From: Kefu Chai Date: Sat, 25 Apr 2020 01:47:00 +0000 (+0800) Subject: qa/tasks/vstart_runner.py: use StringIO for capturing text X-Git-Tag: v15.2.2~50^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b5194acb7a566dae995ec9c7a8f8b896fa44dc9e;p=ceph.git qa/tasks/vstart_runner.py: use StringIO for capturing text to be consistent with 8bfe977854686149c74de3ebaed7b571d43404dd Fixes: https://tracker.ceph.com/issues/45246 Signed-off-by: Kefu Chai (cherry picked from commit 2de78c3bd9eed9bec235b68e8e52b4635e9add61) qa/tasks: Add missing StringIO import This is directly fixed in octopus since it's needed to get the dashboard backend API tests running based on the previous commits of this PR. There is a fix in master but this one uses "from io import StringIO" while we still need to be python2 compatible in octopus. So this import is done with "six" (expects str in python2 instead of "io" (expects unicode in python2). This import line is not cherry-picked from master due to the above mentioned reasons. Signed-off-by: Laura Paduano --- diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 7055ebb7c9d8d..4c1e133f35475 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -30,6 +30,7 @@ Alternative usage: """ +from six import StringIO from io import BytesIO from collections import defaultdict import getpass @@ -935,7 +936,7 @@ class LocalCephManager(CephManager): if watch_channel is not None: args.append("--watch-channel") args.append(watch_channel) - proc = self.controller.run(args=args, wait=False, stdout=BytesIO()) + proc = self.controller.run(args=args, wait=False, stdout=StringIO()) return proc def raw_cluster_cmd(self, *args, **kwargs):