From: Kefu Chai Date: Wed, 17 Jun 2020 09:21:41 +0000 (+0800) Subject: teuthology/task: drop six.string_types X-Git-Tag: 1.1.0~86^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=370f58f4fa96e5752c2b0cae5838b97a49dd2a71;p=teuthology.git teuthology/task: drop six.string_types Signed-off-by: Kefu Chai --- diff --git a/teuthology/task/__init__.py b/teuthology/task/__init__.py index 7bbf6c5e8..eb1d04c8b 100644 --- a/teuthology/task/__init__.py +++ b/teuthology/task/__init__.py @@ -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: diff --git a/teuthology/task/mpi.py b/teuthology/task/mpi.py index eaeb5d6bd..ade4a5cce 100644 --- a/teuthology/task/mpi.py +++ b/teuthology/task/mpi.py @@ -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() diff --git a/teuthology/task/pcp.py b/teuthology/task/pcp.py index 60aceab8a..c4a6b61a4 100644 --- a/teuthology/task/pcp.py +++ b/teuthology/task/pcp.py @@ -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())