]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: drop python2 support
authorKefu Chai <kchai@redhat.com>
Sun, 19 Jul 2020 09:35:47 +0000 (17:35 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 21 Jul 2020 11:52:11 +0000 (19:52 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/cephfs/test_cephfs_shell.py
qa/tasks/cephfs/test_failover.py

index 7880e47376bff11e0c6f171e64aefab4adb4dc9e..37b36a91dbd1e94cb5eca02d497a29172084ecf7 100644 (file)
@@ -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
 
index b14ff70188d2012641b3731b21e3d261e17692fd..1bb1bf2046cd8091bf637ca0811d15dd2b45acf9 100644 (file)
@@ -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