From: Kefu Chai Date: Sun, 28 Jun 2020 11:44:26 +0000 (+0800) Subject: qa/tasks/rbd: drop py2 support X-Git-Tag: wip-pdonnell-testing-20200918.022351~781^2~17 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=29ac8118a338672bec5444c9bb1c633f27d0f66c;p=ceph-ci.git qa/tasks/rbd: drop py2 support Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/rbd.py b/qa/tasks/rbd.py index 6d066a6f23c..7e1128007c5 100644 --- a/qa/tasks/rbd.py +++ b/qa/tasks/rbd.py @@ -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