From: Kefu Chai Date: Sun, 19 Jul 2020 09:35:47 +0000 (+0800) Subject: qa/tasks/cephfs: drop python2 support X-Git-Tag: v16.1.0~1654^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76c4e68be4c03521296de9c9f9a2f872c3aeb277;p=ceph.git qa/tasks/cephfs: drop python2 support Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 7880e47376bf..37b36a91dbd1 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -8,7 +8,6 @@ import crypt import logging from tempfile import mkstemp as tempfile_mkstemp import math -from six import ensure_str from time import sleep from tasks.cephfs.cephfs_test_case import CephFSTestCase from teuthology.misc import sudo_write_file @@ -26,6 +25,13 @@ def humansize(nbytes): f = ('%d' % nbytes).rstrip('.') return '%s%s' % (f, suffixes[i]) +def ensure_str(s): + if isinstance(s, str): + return s + if isinstance(s, bytes): + return s.decode() + raise TypeError("not expecting type '%s'" % type(s)) + class TestCephFSShell(CephFSTestCase): CLIENTS_REQUIRED = 1 diff --git a/qa/tasks/cephfs/test_failover.py b/qa/tasks/cephfs/test_failover.py index b14ff70188d2..1bb1bf2046cd 100644 --- a/qa/tasks/cephfs/test_failover.py +++ b/qa/tasks/cephfs/test_failover.py @@ -3,7 +3,6 @@ import signal import logging import operator from random import randint -from six.moves import range from tasks.cephfs.cephfs_test_case import CephFSTestCase from teuthology.exceptions import CommandFailedError