Track neutron-lib migration of agent extensions
The agent extensions code is migrating to neutron-lib. This change reflects that migration in neutron. NeutronLibImpact - Consumers using the agents extension should now use the Agent extension API from neutron-lib instead of neutron. Co-authored-by: Reedip<reedip.banerjee@gmail.com> Change-Id: Ie8f0e70b11435d627f73e3fed45f946e863e90bc Depends-On: I7255a5ae6b706c09acecc0dea5dbd2febae0c282
This commit is contained in:
parent
fab6bcbdcd
commit
43a8456e33
@ -63,14 +63,14 @@ neutron.agent.l2.extensions namespace.
|
||||
|
||||
The relevant modules are:
|
||||
|
||||
* neutron.agent.agent_extension:
|
||||
* neutron_lib.agent.extension:
|
||||
This module defines an abstract extension interface for all agent
|
||||
extensions across L2 and L3.
|
||||
|
||||
* neutron.agent.l2.l2_agent_extension:
|
||||
* neutron.agent.l3.l3_agent_extension:
|
||||
* neutron_lib.agent.l2_extension:
|
||||
* neutron_lib.agent.l3_extension:
|
||||
These modules subclass
|
||||
neutron.agent.agent_extension.AgentExtension and define a
|
||||
neutron_lib.agent.extension.AgentExtension and define a
|
||||
layer-specific abstract extension interface.
|
||||
|
||||
* neutron.agent.agent_extensions_manager:
|
||||
@ -99,9 +99,9 @@ For L3, see :doc:`L3 agent extensions <l3_agent_extensions>`.
|
||||
|
||||
The relevant modules are:
|
||||
|
||||
* neutron.agent.agent_extension
|
||||
* neutron_lib.agent.extension
|
||||
* neutron_lib.agent.l2_extension
|
||||
* neutron_lib.agent.l3_extension
|
||||
* neutron.agent.agent_extensions_manager
|
||||
* neutron.agent.l2.l2_agent_extension_api
|
||||
* neutron.agent.l2.l2_agent_extensions_manager
|
||||
* neutron.agent.l3.l3_agent_extension_api
|
||||
* neutron.agent.l3.l3_agent_extensions_manager
|
||||
|
@ -1,48 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class AgentExtension(object):
|
||||
"""Define stable abstract interface for agent extensions.
|
||||
|
||||
An agent extension extends the agent core functionality.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def initialize(self, connection, driver_type):
|
||||
"""Perform agent core resource extension initialization.
|
||||
|
||||
:param connection: RPC connection that can be reused by the extension
|
||||
to define its RPC endpoints
|
||||
:param driver_type: a string that defines the agent type to the
|
||||
extension. Can be used to choose the right backend
|
||||
implementation.
|
||||
|
||||
Called after all extensions have been loaded.
|
||||
No resource (port, policy, router, etc.) handling will be called before
|
||||
this method.
|
||||
"""
|
||||
|
||||
def consume_api(self, agent_api):
|
||||
"""Consume the AgentAPI instance from the AgentExtensionsManager.
|
||||
|
||||
Allows an extension to gain access to resources internal to the
|
||||
neutron agent and otherwise unavailable to the extension. Examples of
|
||||
such resources include bridges, ports, and routers.
|
||||
|
||||
:param agent_api: An instance of an agent-specific API.
|
||||
"""
|
@ -1,27 +0,0 @@
|
||||
# Copyright (c) 2015 Mellanox Technologies, Ltd
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from neutron.agent.l2 import l2_agent_extension
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class AgentCoreResourceExtension(l2_agent_extension.L2AgentExtension):
|
||||
"""This is a shim around L2AgentExtension class. It is intended for use by
|
||||
out of tree extensions that were inheriting AgentCoreResourceExtension.
|
||||
"""
|
@ -15,12 +15,12 @@
|
||||
|
||||
import sys
|
||||
|
||||
from neutron_lib.agent import l2_extension
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.utils import helpers
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.agent.l2 import l2_agent_extension
|
||||
from neutron.agent.linux import bridge_lib
|
||||
from neutron.conf.agent import l2_ext_fdb_population
|
||||
from neutron.plugins.ml2.drivers.linuxbridge.agent.common import (
|
||||
@ -34,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FdbPopulationAgentExtension(
|
||||
l2_agent_extension.L2AgentExtension):
|
||||
l2_extension.L2AgentExtension):
|
||||
"""The FDB population is an agent extension to OVS or linux bridge
|
||||
who's objective is to update the FDB table for existing instance
|
||||
using normal port, thus enabling communication between SR-IOV instances
|
||||
|
@ -16,13 +16,13 @@
|
||||
import abc
|
||||
import collections
|
||||
|
||||
from neutron_lib.agent import l2_extension
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from neutron.agent.l2 import l2_agent_extension
|
||||
from neutron.api.rpc.callbacks.consumer import registry
|
||||
from neutron.api.rpc.callbacks import events
|
||||
from neutron.api.rpc.callbacks import resources
|
||||
@ -194,7 +194,7 @@ class PortPolicyMap(object):
|
||||
del self.known_policies[qos_policy_id]
|
||||
|
||||
|
||||
class QosAgentExtension(l2_agent_extension.L2AgentExtension):
|
||||
class QosAgentExtension(l2_extension.L2AgentExtension):
|
||||
SUPPORTED_RESOURCE_TYPES = [resources.QOS_POLICY]
|
||||
|
||||
def initialize(self, connection, driver_type):
|
||||
|
@ -1,48 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from neutron.agent import agent_extension
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class L2AgentExtension(agent_extension.AgentExtension):
|
||||
"""Define stable abstract interface for l2 agent extensions.
|
||||
|
||||
An agent extension extends the agent core functionality.
|
||||
"""
|
||||
|
||||
def initialize(self, connection, driver_type):
|
||||
"""Initialize agent extension."""
|
||||
|
||||
@abc.abstractmethod
|
||||
def handle_port(self, context, data):
|
||||
"""Handle agent extension for port.
|
||||
|
||||
This can be called on either create or update, depending on the
|
||||
code flow. Thus, it's this function's responsibility to check what
|
||||
actually changed.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: port data
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def delete_port(self, context, data):
|
||||
"""Delete port from agent extension.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: port data
|
||||
"""
|
@ -1,65 +0,0 @@
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from neutron.agent import agent_extension
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class L3AgentCoreResourceExtension(agent_extension.AgentExtension):
|
||||
"""Define stable abstract interface for l3 agent extensions.
|
||||
|
||||
An agent extension extends the agent core functionality.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def add_router(self, context, data):
|
||||
"""add agent extension for router.
|
||||
|
||||
Called on router create.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: router data
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def update_router(self, context, data):
|
||||
"""Handle agent extension for update.
|
||||
|
||||
Called on router update.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: router data
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def delete_router(self, context, data):
|
||||
"""Delete router from agent extension.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: router data
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def ha_state_change(self, context, data):
|
||||
"""Change router state from agent extension.
|
||||
|
||||
Called on HA router state change.
|
||||
|
||||
:param context: rpc context
|
||||
:param data: dict of router_id and new state
|
||||
"""
|
@ -16,11 +16,11 @@
|
||||
import abc
|
||||
import contextlib
|
||||
|
||||
from neutron_lib.agent import extension
|
||||
from neutron_lib import constants
|
||||
from oslo_concurrency import lockutils
|
||||
import six
|
||||
|
||||
from neutron.agent import agent_extension
|
||||
from neutron.api.rpc.callbacks.consumer import registry
|
||||
from neutron.api.rpc.callbacks import events
|
||||
from neutron.api.rpc.callbacks import resources
|
||||
@ -80,7 +80,7 @@ class LoggingDriver(object):
|
||||
self.defer_apply_off()
|
||||
|
||||
|
||||
class LoggingExtension(agent_extension.AgentExtension):
|
||||
class LoggingExtension(extension.AgentExtension):
|
||||
SUPPORTED_RESOURCE_TYPES = [resources.LOGGING_RESOURCE]
|
||||
|
||||
def initialize(self, connection, driver_type):
|
||||
|
Loading…
Reference in New Issue
Block a user