]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/task: drop six.string_types
authorKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 09:21:41 +0000 (17:21 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 14:19:20 +0000 (22:19 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/task/__init__.py
teuthology/task/mpi.py
teuthology/task/pcp.py

index 7bbf6c5e8b02255d09e338aed4170275ba2a7ec5..eb1d04c8b8328769e9333a99f6fdf569a999f230 100644 (file)
@@ -1,7 +1,5 @@
 import logging
 
-from six import string_types as basestring
-
 from teuthology.misc import deep_merge
 from teuthology.orchestra.cluster import Cluster
 
@@ -76,7 +74,7 @@ class Task(object):
             if len(role_matches.remotes) > 0:
                 for (remote, roles) in role_matches.remotes.items():
                     cluster.add(remote, roles)
-            elif isinstance(host_spec, basestring):
+            elif isinstance(host_spec, str):
                 for (remote, roles) in self.ctx.cluster.remotes.items():
                     if remote.name.split('@')[-1] == host_spec or \
                             remote.shortname == host_spec:
index eaeb5d6bd5a525cca836dbc88d0be10a69296562..ade4a5ccec8145c015d65791abc74510e388c8d3 100644 (file)
@@ -5,7 +5,6 @@ import logging
 import re
 
 from teuthology import misc as teuthology
-from six import string_types as basestring
 
 log = logging.getLogger(__name__)
 
@@ -92,7 +91,7 @@ def task(ctx, config):
     remotes = []
     master_remote = None
     if 'nodes' in config:
-        if isinstance(config['nodes'], basestring) and config['nodes'] == 'all':
+        if isinstance(config['nodes'], str) and config['nodes'] == 'all':
             for role in  teuthology.all_roles(ctx.cluster):
                 (remote,) = ctx.cluster.only(role).remotes.keys()
                 ip,port = remote.ssh.get_transport().getpeername()
index 60aceab8aef02dcddfa53d94fca1444da0b3a0a3..c4a6b61a40c15777852375e218218135af14d397 100644 (file)
@@ -13,9 +13,6 @@ from teuthology.config import config as teuth_config
 from teuthology.orchestra import run
 
 from teuthology import misc
-
-from six import string_types as basestring
-
 from teuthology.task import Task
 
 log = logging.getLogger(__name__)
@@ -56,7 +53,7 @@ class PCPArchive(PCPDataSource):
 
     @staticmethod
     def _format_time(seconds):
-        if isinstance(seconds, basestring):
+        if isinstance(seconds, str):
             return seconds
         return "@ %s" % time.asctime(time.gmtime(seconds))
 
@@ -91,7 +88,7 @@ class GrafanaGrapher(PCPGrapher):
 
     @staticmethod
     def _format_time(seconds):
-        if isinstance(seconds, basestring):
+        if isinstance(seconds, str):
             return seconds
         seconds = int(seconds)
         dt = datetime.datetime.fromtimestamp(seconds, dateutil.tz.tzutc())