]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/vstart_runner.py: use StringIO for capturing text 34759/head
authorKefu Chai <kchai@redhat.com>
Sat, 25 Apr 2020 01:47:00 +0000 (09:47 +0800)
committerLaura Paduano <lpaduano@suse.com>
Tue, 28 Apr 2020 07:21:59 +0000 (09:21 +0200)
to be consistent with 8bfe977854686149c74de3ebaed7b571d43404dd

Fixes: https://tracker.ceph.com/issues/45246
Signed-off-by: Kefu Chai <kchai@redhat.com>
(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 <lpaduano@suse.com>
qa/tasks/vstart_runner.py

index 7055ebb7c9d8d71fe8eb5285704932e584e9c97b..4c1e133f354752acdd1b13cecc6b508ca7dbd613 100644 (file)
@@ -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):