]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/divergent_priors2: get rid of cStringIO for py3
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 21 Feb 2020 21:28:56 +0000 (22:28 +0100)
committerKefu Chai <kchai@redhat.com>
Wed, 4 Mar 2020 05:09:17 +0000 (13:09 +0800)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
qa/tasks/divergent_priors2.py

index 12a9fd4a9afc0d1c3dc1ec33040fd5158cf39090..dda358b045fd39f0543a516ee186cf2412b2e0f4 100644 (file)
@@ -3,8 +3,8 @@ Special case divergence test with ceph-objectstore-tool export/remove/import
 """
 import logging
 import time
-from cStringIO import StringIO
 
+from teuthology.exceptions import CommandFailedError
 from teuthology import misc as teuthology
 from util.rados import rados
 import os
@@ -158,15 +158,17 @@ def task(ctx, config):
     expfile = os.path.join(testdir, "exp.{pid}.out".format(pid=pid))
     cmd = ((prefix + "--op export-remove --pgid 2.0 --file {file}").
            format(id=divergent, file=expfile))
-    proc = exp_remote.run(args=cmd, wait=True,
-                          check_status=False, stdout=StringIO())
-    assert proc.exitstatus == 0
+    try:
+        exp_remote.sh(cmd, wait=True)
+    except CommandFailedError as e:
+        assert e.exitstatus == 0
 
     cmd = ((prefix + "--op import --file {file}").
            format(id=divergent, file=expfile))
-    proc = exp_remote.run(args=cmd, wait=True,
-                          check_status=False, stdout=StringIO())
-    assert proc.exitstatus == 0
+    try:
+        exp_remote.sh(cmd, wait=True)
+    except CommandFailedError as e:
+        assert e.exitstatus == 0
 
     log.info("reviving divergent %d", divergent)
     manager.revive_osd(divergent)