Remove usage of six

Remove six-library Replace the following items with Python 3 style code.
- six.six.add_metaclass
- six.PY2
- requirement.txt

Change-Id: Ib87394e41cdba7fc57e6ae6ed08ba1f84465441e
This commit is contained in:
zhangtongjian 2022-06-03 14:52:18 +08:00 committed by Lajos Katona
parent e4fbbaae08
commit b126f4224a
8 changed files with 11 additions and 32 deletions

View File

@ -15,10 +15,5 @@
import gettext
import six
if six.PY2:
gettext.install('neutron', unicode=1)
else:
gettext.install('neutron')
gettext.install('neutron')

View File

@ -22,7 +22,6 @@ from neutron_lib.api import extensions
from neutron_lib.exceptions import firewall_v2 as f_exc
from neutron_lib.services import base as service_base
from oslo_config import cfg
import six
from neutron_fwaas._i18n import _
from neutron_fwaas.common import fwaas_constants
@ -221,8 +220,9 @@ class Firewall_v2(extensions.APIExtensionDescriptor):
return Firewallv2PluginBase
@six.add_metaclass(abc.ABCMeta)
class Firewallv2PluginBase(service_base.ServicePluginBase):
class Firewallv2PluginBase(
service_base.ServicePluginBase,
metaclass=abc.ABCMeta):
def get_plugin_type(self):
return fwaas_constants.FIREWALL_V2

View File

@ -15,7 +15,6 @@
import abc
import six
from neutron_lib.utils import runtime
from oslo_config import cfg
@ -38,8 +37,7 @@ def load_and_init_conntrack_driver(*args, **kwargs):
return conntrack_driver
@six.add_metaclass(abc.ABCMeta)
class ConntrackDriverBase(object):
class ConntrackDriverBase(object, metaclass=abc.ABCMeta):
"""Base Driver for Conntrack"""
@abc.abstractmethod

View File

@ -15,11 +15,8 @@
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class FwaasDriverBase(object):
class FwaasDriverBase(object, metaclass=abc.ABCMeta):
"""Firewall as a Service Driver base class.
Using FwaasDriver Class, an instance of L3 perimeter Firewall

View File

@ -15,11 +15,8 @@
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class FwaasDriverBase(object):
class FwaasDriverBase(object, metaclass=abc.ABCMeta):
"""Firewall as a Service Driver base class.
Using FwaasDriver Class, an instance of L3 perimeter Firewall

View File

@ -15,11 +15,8 @@
import abc
import contextlib
import six
@six.add_metaclass(abc.ABCMeta)
class FirewallL2DriverBase(object):
class FirewallL2DriverBase(object, metaclass=abc.ABCMeta):
"""Abstract firewall L2 driver base"""
def __init__(self, integration_bridge, sg_enabled=False):

View File

@ -16,7 +16,6 @@
import abc
import copy
import six
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
@ -31,8 +30,7 @@ from neutron_fwaas.db.firewall.v2 import firewall_db_v2
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class FirewallDriver(object):
class FirewallDriver(object, metaclass=abc.ABCMeta):
"""Firewall v2 interface for driver
That driver interface does not persist Firewall v2 data in any database.
@ -124,8 +122,7 @@ class FirewallDriver(object):
pass
@six.add_metaclass(abc.ABCMeta)
class FirewallDriverDBMixin(FirewallDriver):
class FirewallDriverDBMixin(FirewallDriver, metaclass=abc.ABCMeta):
"""FirewallDriverDB mixin to provision the database on behalf of the driver
That driver interface persists Firewall data in its database and forwards
@ -519,8 +516,7 @@ class FirewallDriverDB(FirewallDriverDBMixin):
pass
@six.add_metaclass(abc.ABCMeta)
class FirewallDriverRPCMixin(object):
class FirewallDriverRPCMixin(object, metaclass=abc.ABCMeta):
"""FirewallAgent interface for driver with rpc callback listener.
Each firewall backend driver that needs a rpc callback listener should

View File

@ -11,7 +11,6 @@ eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
netaddr>=0.7.18 # BSD
SQLAlchemy>=1.4.23 # MIT
alembic>=1.6.5 # MIT
six>=1.10.0 # MIT
neutron-lib>=1.26.0 # Apache-2.0
os-ken >= 0.3.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0