]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
python-common: drop python2 support
authorKefu Chai <kchai@redhat.com>
Sun, 19 Jul 2020 09:41:22 +0000 (17:41 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 22 Jul 2020 03:55:49 +0000 (11:55 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/python-common/README.rst
src/python-common/ceph/deployment/drive_group.py
src/python-common/ceph/deployment/service_spec.py
src/python-common/requirements.txt
src/python-common/setup.py

index 07f42fd147e2f9bf8c356beb6da2f4c591116f31..3900ec4f944cac3aebe5f863a291aaa209f149d8 100644 (file)
@@ -11,11 +11,6 @@ Like for example:
 - ``ceph`` command line interface and other Ceph tools.
 - Also external tools.
 
-Requirements
-============
-
-- ``python-six``
-
 Usage
 =====
 
index 85da04bf29799be11cf7e8787a79b2a58ff2f17c..2837c6571e1898b0db46d53852df77881e2f74fa 100644 (file)
@@ -7,7 +7,6 @@ try:
     from typing import Optional, List, Dict, Any
 except ImportError:
     pass
-import six
 
 
 class DeviceSelection(object):
@@ -257,7 +256,7 @@ class DriveGroupSpec(ServiceSpec):
 
         for key in ('block_wal_size', 'block_db_size', 'journal_size'):
             if key in json_drive_group:
-                if isinstance(json_drive_group[key], six.string_types):
+                if isinstance(json_drive_group[key], str):
                     from ceph.deployment.drive_selection import SizeMatcher
                     json_drive_group[key] = SizeMatcher.str_to_byte(json_drive_group[key])
 
@@ -277,7 +276,7 @@ class DriveGroupSpec(ServiceSpec):
         if not self.service_id:
             raise DriveGroupValidationError('service_id is required')
 
-        if not isinstance(self.placement.host_pattern, six.string_types) and \
+        if not isinstance(self.placement.host_pattern, str) and \
                 self.placement.host_pattern is not None:
             raise DriveGroupValidationError('host_pattern must be of type string')
 
index 9111c75ad71e7b623aa6e41418984e08e8a925a6..e1f0e440edb1b80958cad6f497391d617bcfc48b 100644 (file)
@@ -4,7 +4,6 @@ from collections import namedtuple, OrderedDict
 from functools import wraps
 from typing import Optional, Dict, Any, List, Union, Callable, Iterator
 
-import six
 import yaml
 
 from ceph.deployment.hostspec import HostSpec
@@ -123,9 +122,9 @@ class HostPlacementSpec(namedtuple('HostPlacementSpec', ['hostname', 'network',
             try:
                 # if subnets are defined, also verify the validity
                 if '/' in network:
-                    ip_network(six.text_type(network))
+                    ip_network(network)
                 else:
-                    ip_address(six.text_type(network))
+                    ip_address(network)
             except ValueError as e:
                 # logging?
                 raise e
index 7df43fb736afddb868d1baf54487b7890a17f43c..d472610f624214d6b34a90f1dce4f66e522f77b7 100644 (file)
@@ -1,4 +1,3 @@
-six
 pytest >=2.1.3,<5; python_version < '3.5'
 mock; python_version < '3.3'
 mypy==0.782; python_version >= '3'
index 48daee6dee4d7945872c9da7973d1a248c9682c3..369c928f928b85b8a458df74257744b99b8b832a 100644 (file)
@@ -17,9 +17,6 @@ setup(
     keywords='ceph',
     url="https://github.com/ceph/ceph",
     zip_safe = False,
-    install_requires=(
-        'six',
-    ),
     classifiers = [
         'Intended Audience :: Developer',
         'Operating System :: POSIX :: Linux',