]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/rbd: drop py2 support
authorKefu Chai <kchai@redhat.com>
Sun, 28 Jun 2020 11:44:26 +0000 (19:44 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 5 Jul 2020 02:58:28 +0000 (10:58 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/rbd.py

index 6d066a6f23c2b6f784935463e8304a0dd0163f4b..7e1128007c5206bc573d2273126c394e183907c9 100644 (file)
@@ -7,7 +7,7 @@ import os
 import tempfile
 import sys
 
-from io import BytesIO
+from io import StringIO
 from teuthology.orchestra import run
 from teuthology import misc as teuthology
 from teuthology import contextutil
@@ -303,12 +303,12 @@ def canonical_path(ctx, role, path):
     representing the given role.  A canonical path contains no
     . or .. components, and includes no symbolic links.
     """
-    version_fp = BytesIO()
+    version_fp = StringIO()
     ctx.cluster.only(role).run(
         args=[ 'readlink', '-f', path ],
         stdout=version_fp,
         )
-    canonical_path = six.ensure_str(version_fp.getvalue()).rstrip('\n')
+    canonical_path = version_fp.getvalue().rstrip('\n')
     version_fp.close()
     return canonical_path