From b5194acb7a566dae995ec9c7a8f8b896fa44dc9e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 25 Apr 2020 09:47:00 +0800 Subject: [PATCH] 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 --- qa/tasks/vstart_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): -- 2.39.5