import abc
import contextlib
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class FirewallDriver(object):
"""Firewall Driver base class.
remote_group_id will also remaining membership update management
"""
- __metaclass__ = abc.ABCMeta
-
def prepare_port_filter(self, port):
"""Prepare filters for the port.
import abc
from oslo.config import cfg
+import six
from neutron.common import log
+@six.add_metaclass(abc.ABCMeta)
class L2populationRpcCallBackMixin(object):
- __metaclass__ = abc.ABCMeta
@log.log
def add_fdb_entries(self, context, fdb_entries, host=None):
import netaddr
from oslo.config import cfg
+import six
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
return self._ns_name
+@six.add_metaclass(abc.ABCMeta)
class DhcpBase(object):
- __metaclass__ = abc.ABCMeta
def __init__(self, conf, network, root_helper='sudo',
version=None, plugin=None):
import netaddr
from oslo.config import cfg
+import six
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
]
+@six.add_metaclass(abc.ABCMeta)
class LinuxInterfaceDriver(object):
- __metaclass__ = abc.ABCMeta
# from linux IF_NAMESIZE
DEV_NAME_LEN = 14
from oslo.config import cfg
import routes
+import six
import webob.dec
import webob.exc
LOG = logging.getLogger(__name__)
+@six.add_metaclass(ABCMeta)
class PluginInterface(object):
- __metaclass__ = ABCMeta
@classmethod
def __subclasshook__(cls, klass):
import abc
from oslo.config import cfg
+import six
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
return {}
+@six.add_metaclass(abc.ABCMeta)
class FirewallPluginBase(ServicePluginBase):
- __metaclass__ = abc.ABCMeta
def get_plugin_name(self):
return constants.FIREWALL
import abc
from oslo.config import cfg
+import six
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
return {}
+@six.add_metaclass(abc.ABCMeta)
class LoadBalancerPluginBase(ServicePluginBase):
- __metaclass__ = abc.ABCMeta
def get_plugin_name(self):
return constants.LOADBALANCER
import abc
+import six
+
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
from neutron.api.v2 import base
return {}
+@six.add_metaclass(abc.ABCMeta)
class MeteringPluginBase(service_base.ServicePluginBase):
- __metaclass__ = abc.ABCMeta
def get_plugin_name(self):
return constants.METERING
from abc import abstractmethod
from oslo.config import cfg
+import six
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
return {}
+@six.add_metaclass(ABCMeta)
class SecurityGroupPluginBase(object):
- __metaclass__ = ABCMeta
@abstractmethod
def create_security_group(self, context, security_group):
import abc
from oslo.config import cfg
+import six
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
return {}
+@six.add_metaclass(abc.ABCMeta)
class VPNPluginBase(ServicePluginBase):
- __metaclass__ = abc.ABCMeta
def get_plugin_name(self):
return constants.VPN
from abc import ABCMeta, abstractmethod
+import six
-class NeutronPluginBaseV2(object):
- __metaclass__ = ABCMeta
+@six.add_metaclass(ABCMeta)
+class NeutronPluginBaseV2(object):
@abstractmethod
def create_subnet(self, context, subnet):
from abc import ABCMeta, abstractmethod
import inspect
+import six
+
+@six.add_metaclass(ABCMeta)
class L2DevicePluginBase(object):
"""Base class for a device-specific plugin.
the configuration on each device.
"""
- __metaclass__ = ABCMeta
-
@abstractmethod
def get_all_networks(self, tenant_id, **kwargs):
"""Get newtorks.
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class SupportBase(object):
"""abstract support class.
the L2 base for Embrane plugin.
"""
- __metaclass__ = abc.ABCMeta
@abc.abstractmethod
def __init__(self):
from abc import ABCMeta, abstractmethod, abstractproperty
+import six
+
# The following keys are used in the segment dictionaries passed via
# the driver API. These are defined separately from similar keys in
# neutron.extensions.providernet so that drivers don't need to change
SEGMENTATION_ID = 'segmentation_id'
+@six.add_metaclass(ABCMeta)
class TypeDriver(object):
"""Define stable abstract interface for ML2 type drivers.
either be excluded or stored as None.
"""
- __metaclass__ = ABCMeta
-
@abstractmethod
def get_type(self):
"""Get driver's network type.
pass
+@six.add_metaclass(ABCMeta)
class NetworkContext(object):
"""Context passed to MechanismDrivers for changes to network resources.
MechanismDrivers can freely access the same information.
"""
- __metaclass__ = ABCMeta
-
@abstractproperty
def current(self):
"""Return the current state of the network.
pass
+@six.add_metaclass(ABCMeta)
class SubnetContext(object):
"""Context passed to MechanismDrivers for changes to subnet resources.
MechanismDrivers can freely access the same information.
"""
- __metaclass__ = ABCMeta
-
@abstractproperty
def current(self):
"""Return the current state of the subnet.
pass
+@six.add_metaclass(ABCMeta)
class PortContext(object):
"""Context passed to MechanismDrivers for changes to port resources.
freely access the same information.
"""
- __metaclass__ = ABCMeta
-
@abstractproperty
def current(self):
"""Return the current state of the port.
pass
+@six.add_metaclass(ABCMeta)
class MechanismDriver(object):
"""Define stable abstract interface for ML2 mechanism drivers.
methods that are part of the database transaction.
"""
- __metaclass__ = ABCMeta
-
@abstractmethod
def initialize(self):
"""Perform driver initialization.
from abc import ABCMeta, abstractmethod
+import six
+
from neutron.openstack.common import log
from neutron.plugins.ml2 import driver_api as api
LOG = log.getLogger(__name__)
+@six.add_metaclass(ABCMeta)
class AgentMechanismDriverBase(api.MechanismDriver):
"""Base class for drivers that attach to networks using an L2 agent.
check_segment_for_agent().
"""
- __metaclass__ = ABCMeta
-
def __init__(self, agent_type, vif_type, cap_port_filter):
"""Initialize base class for specific L2 agent type.
# under the License.
from abc import ABCMeta, abstractmethod
+import six
+
from neutron.common import exceptions as exc
from neutron.common import topics
from neutron.openstack.common import log
TUNNEL = 'tunnel'
+@six.add_metaclass(ABCMeta)
class TunnelTypeDriver(api.TypeDriver):
"""Define stable abstract interface for ML2 type drivers.
methods to manage these endpoints.
"""
- __metaclass__ = ABCMeta
-
@abstractmethod
def add_endpoint(self, ip):
"""Register the endpoint in the type_driver database.
from abc import ABCMeta, abstractmethod
+import six
+
+@six.add_metaclass(ABCMeta)
class OFCDriverBase(object):
"""OpenFlow Controller (OFC) Driver Specification.
It would be better that other methods like update_* are implemented.
"""
- __metaclass__ = ABCMeta
-
@abstractmethod
def create_tenant(self, description, tenant_id=None):
"""Create a new tenant at OpenFlow Controller.
import abc
import httplib
+import six
+
from neutron.common import log as call_log
from neutron.common import utils
from neutron.openstack.common import excutils
PROVIDER_OPENFLOW = nconst.ROUTER_PROVIDER_OPENFLOW
+@six.add_metaclass(abc.ABCMeta)
class RouterDriverBase(object):
- __metaclass__ = abc.ABCMeta
-
def __init__(self, plugin, ofc_manager):
self.plugin = plugin
self.ofc = ofc_manager
import logging
import time
+import six
from neutron.plugins.nicira.api_client.common import (
_conn_str)
DEFAULT_CONNECT_TIMEOUT = 5
+@six.add_metaclass(ABCMeta)
class NvpApiClient(object):
'''An abstract baseclass for all NvpApiClient implementations.
coroutine-based classes.
'''
- __metaclass__ = ABCMeta
-
CONN_IDLE_TIMEOUT = 60 * 15
def _create_connection(self, host, port, is_ssl):
import time
import urlparse
+import six
+
from neutron.openstack.common import excutils
from neutron.plugins.nicira.api_client.common import (
_conn_str)
# for downloads, see: django/nvp_console/views.py
+@six.add_metaclass(ABCMeta)
class NvpApiRequest(object):
'''An abstract baseclass for all ApiRequest implementations.
gevent-based ApiRequest classes.
'''
- __metaclass__ = ABCMeta
-
# List of allowed status codes.
ALLOWED_STATUS_CODES = [
httplib.OK,
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class FwaasDriverBase(object):
"""Firewall as a Service Driver base class.
application of rules.
"""
- __metaclass__ = abc.ABCMeta
-
@abc.abstractmethod
def create_firewall(self, apply_list, firewall):
"""Create the Firewall with default (drop all) policy.
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class LoadBalancerAbstractDriver(object):
"""Abstract lbaas driver that expose ~same API as lbaas plugin.
Get operations are not part of the API - it will be handled
by the lbaas plugin.
"""
- __metaclass__ = abc.ABCMeta
@abc.abstractmethod
def create_vip(self, context, vip):
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class MeteringAbstractDriver(object):
"""Abstract Metering driver."""
- __metaclass__ = abc.ABCMeta
def __init__(self, plugin, conf):
pass
import abc
+import six
+
from neutron.api import extensions
from neutron.db import servicetype_db as sdb
from neutron.openstack.common import importutils
LOG = logging.getLogger(__name__)
+@six.add_metaclass(abc.ABCMeta)
class ServicePluginBase(extensions.PluginInterface):
"""Define base interface for any Advanced Service plugin."""
- __metaclass__ = abc.ABCMeta
supported_extension_aliases = []
@abc.abstractmethod
# under the License.
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class DeviceDriver(object):
- __metaclass__ = abc.ABCMeta
def __init__(self, agent, host):
pass
import jinja2
import netaddr
from oslo.config import cfg
+import six
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
return JINJA_ENV.get_template(template_file)
+@six.add_metaclass(abc.ABCMeta)
class BaseSwanProcess():
"""Swan Family Process Manager
This class manages start/restart/stop ipsec process.
This class create/delete config template
"""
- __metaclass__ = abc.ABCMeta
binary = "ipsec"
CONFIG_DIRS = [
topic=self.topic)
+@six.add_metaclass(abc.ABCMeta)
class IPsecDriver(device_drivers.DeviceDriver):
"""VPN Device Driver for IPSec.
# 1.0 Initial version
RPC_API_VERSION = '1.0'
- __metaclass__ = abc.ABCMeta
def __init__(self, agent, host):
self.agent = agent
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class VpnDriver(object):
- __metaclass__ = abc.ABCMeta
@property
def service_type(self):