]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/workunit: drop py2 support
authorKefu Chai <kchai@redhat.com>
Sun, 28 Jun 2020 11:46:01 +0000 (19:46 +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/workunit.py

index 46eeef41f2e089890268059db9418e508fa3cfa5..b01ef74a5f70554987be9a7206e11daa77d3663d 100644 (file)
@@ -6,8 +6,6 @@ import pipes
 import os
 import re
 
-import six
-
 from tasks.util import get_remote_for_role
 from tasks.util.workunit import get_refspec_after_overrides
 
@@ -105,7 +103,7 @@ def task(ctx, config):
     # Create scratch dirs for any non-all workunits
     log.info('Making a separate scratch dir for every client...')
     for role in clients.keys():
-        assert isinstance(role, six.string_types)
+        assert isinstance(role, str)
         if role == "all":
             continue
 
@@ -316,7 +314,7 @@ def _run_tests(ctx, refspec, role, tests, env, basedir,
                     to False is passed, the 'timeout' command is not used.
     """
     testdir = misc.get_testdir(ctx)
-    assert isinstance(role, six.string_types)
+    assert isinstance(role, str)
     cluster, type_, id_ = misc.split_role(role)
     assert type_ == 'client'
     remote = get_remote_for_role(ctx, role)
@@ -364,7 +362,7 @@ def _run_tests(ctx, refspec, role, tests, env, basedir,
     )
 
     workunits_file = '{tdir}/workunits.list.{role}'.format(tdir=testdir, role=role)
-    workunits = sorted(six.ensure_str(misc.get_file(remote, workunits_file)).split('\0'))
+    workunits = sorted(misc.get_file(remote, workunits_file).decode().split('\0'))
     assert workunits
 
     try: