Drop using six library

Since we dropped python 2 support and testing in[1], there is
no compatibility with Python2 now. We can stop using python
six module.

[1] https://review.opendev.org/#/c/698245/

Change-Id: I15771f129ada53f1f8ca6683c8d80d5675332db5
This commit is contained in:
Dongcan Ye 2020-01-07 06:26:03 +00:00
parent 7d851c6401
commit 5b3a139c4a
10 changed files with 9 additions and 38 deletions

View File

@ -124,7 +124,6 @@ rfc3986==0.3.1
Routes==2.3.1
ryu==4.24
simplejson==3.5.1
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.6.2
sphinxcontrib-websupport==1.0.1

View File

@ -15,11 +15,5 @@
import gettext
import six
if six.PY2:
# pylint: disable=unexpected-keyword-arg
gettext.install('neutron', unicode=1)
else:
gettext.install('neutron')
gettext.install('neutron')

View File

@ -14,8 +14,6 @@
import abc
import six
from neutron.api.v2 import resource_helper
from neutron_lib.api import converters
@ -98,8 +96,7 @@ class Vpn_endpoint_groups(extensions.ExtensionDescriptor):
return {}
@six.add_metaclass(abc.ABCMeta)
class VPNEndpointGroupsPluginBase(object):
class VPNEndpointGroupsPluginBase(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def create_endpoint_group(self, context, endpoint_group):

View File

@ -23,8 +23,6 @@ from neutron_lib import exceptions as nexception
from neutron_lib.plugins import constants as nconstants
from neutron_lib.services import base as service_base
import six
from neutron.api.v2 import resource_helper
from neutron_vpnaas._i18n import _
@ -514,8 +512,7 @@ class Vpnaas(extensions.ExtensionDescriptor):
return {}
@six.add_metaclass(abc.ABCMeta)
class VPNPluginBase(service_base.ServicePluginBase):
class VPNPluginBase(service_base.ServicePluginBase, metaclass=abc.ABCMeta):
def get_plugin_type(self):
return nconstants.VPN

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import configparser as ConfigParser
import errno
import os
import sys
@ -24,15 +25,9 @@ from neutron_lib.utils import helpers
from oslo_config import cfg
from oslo_log import log as logging
from oslo_rootwrap import wrapper
import six
from neutron_vpnaas._i18n import _
if six.PY3:
import configparser as ConfigParser
else:
import ConfigParser
LOG = logging.getLogger(__name__)

View File

@ -14,11 +14,8 @@
# under the License.
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class DeviceDriver(object):
class DeviceDriver(object, metaclass=abc.ABCMeta):
def __init__(self, agent, host):
pass

View File

@ -40,7 +40,6 @@ import oslo_messaging
from oslo_service import loopingcall
from oslo_utils import encodeutils
from oslo_utils import fileutils
import six
from neutron_vpnaas._i18n import _
from neutron_vpnaas.extensions import vpnaas
@ -134,8 +133,7 @@ def _get_template(template_file):
return JINJA_ENV.get_template(template_file)
@six.add_metaclass(abc.ABCMeta)
class BaseSwanProcess(object):
class BaseSwanProcess(object, metaclass=abc.ABCMeta):
"""Swan Family Process Manager
This class manages start/restart/stop ipsec process.
@ -796,8 +794,7 @@ class IPsecVpnDriverApi(object):
return cctxt.call(context, 'update_status', status=status)
@six.add_metaclass(abc.ABCMeta)
class IPsecDriver(device_drivers.DeviceDriver):
class IPsecDriver(device_drivers.DeviceDriver, metaclass=abc.ABCMeta):
"""VPN Device Driver for IPSec.
This class is designed for use with L3-agent now.

View File

@ -20,15 +20,13 @@ from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
import oslo_messaging
import six
from neutron_vpnaas.services.vpn.service_drivers import driver_validator
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class VpnDriver(object):
class VpnDriver(object, metaclass=abc.ABCMeta):
def __init__(self, service_plugin, validator=None):
self.service_plugin = service_plugin

View File

@ -16,7 +16,6 @@ import abc
import netaddr
import oslo_messaging
import six
from neutron.db.models import l3agent
from neutron.db.models import servicetype
@ -97,8 +96,7 @@ class IPsecVpnAgentApi(service_drivers.BaseIPsecVpnAgentApi):
topic, default_version, driver)
@six.add_metaclass(abc.ABCMeta)
class BaseIPsecVPNDriver(service_drivers.VpnDriver):
class BaseIPsecVPNDriver(service_drivers.VpnDriver, metaclass=abc.ABCMeta):
"""Base VPN Service Driver class."""
def __init__(self, service_plugin, validator=None):

View File

@ -8,7 +8,6 @@ Jinja2>=2.10 # BSD License (3 clause)
netaddr>=0.7.18 # BSD
SQLAlchemy>=1.2.0 # MIT
alembic>=0.8.10 # MIT
six>=1.10.0 # MIT
neutron-lib>=1.18.0 # Apache-2.0
oslo.concurrency>=3.26.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0