From 7bd521e7ce1c4ffe5b65aad12f3a1c1394c55473 Mon Sep 17 00:00:00 2001 From: Boden R Date: Wed, 18 Jan 2017 13:12:40 -0700 Subject: [PATCH] use neutron_lib's portbindings api-def Neutron-lib 1.1.0 is now out and contains the portbindings API definition (as per commit [1]). This patch moves neutron references over to the neutron-lib version. NeutronLibImpact - Consumers using the public constants within neutron's portbindings API extension must now use the values from neutron-lib. [1] 87e42f993c07ae320159d5123662ee9f3bd4d903 Change-Id: I669af9b4c712877772d91a03857ab108714001d4 --- doc/source/devref/contribute.rst | 2 +- neutron/agent/l3/ha_router.py | 2 +- neutron/api/rpc/handlers/dhcp_rpc.py | 2 +- neutron/api/rpc/handlers/l3_rpc.py | 2 +- neutron/db/dvr_mac_db.py | 2 +- neutron/db/ipam_backend_mixin.py | 2 +- neutron/db/ipam_pluggable_backend.py | 2 +- neutron/db/l3_dvr_db.py | 2 +- neutron/db/l3_dvrscheduler_db.py | 2 +- neutron/db/l3_hamode_db.py | 2 +- neutron/db/l3_hascheduler_db.py | 2 +- neutron/db/portbindings_db.py | 2 +- neutron/debug/debug_agent.py | 2 +- neutron/extensions/portbindings.py | 141 +----------------- neutron/plugins/ml2/db.py | 2 +- neutron/plugins/ml2/driver_context.py | 2 +- .../mech_driver/mech_linuxbridge.py | 2 +- .../macvtap/mech_driver/mech_macvtap.py | 2 +- neutron/plugins/ml2/drivers/mech_agent.py | 2 +- .../mech_sriov/agent/sriov_nic_agent.py | 2 +- .../mech_sriov/mech_driver/mech_driver.py | 2 +- .../openvswitch/agent/ovs_neutron_agent.py | 2 +- .../mech_driver/mech_openvswitch.py | 2 +- neutron/plugins/ml2/managers.py | 2 +- neutron/plugins/ml2/models.py | 2 +- neutron/plugins/ml2/plugin.py | 2 +- neutron/plugins/ml2/rpc.py | 2 +- .../qos/drivers/linuxbridge/driver.py | 2 +- .../qos/drivers/openvswitch/driver.py | 2 +- neutron/services/qos/drivers/sriov/driver.py | 2 +- .../trunk/drivers/linuxbridge/driver.py | 2 +- .../trunk/drivers/openvswitch/driver.py | 2 +- neutron/services/trunk/plugin.py | 2 +- neutron/services/trunk/rpc/server.py | 2 +- neutron/services/trunk/rules.py | 2 +- neutron/tests/fullstack/resources/client.py | 2 +- neutron/tests/fullstack/resources/machine.py | 2 +- .../functional/agent/l3/test_dvr_router.py | 2 +- .../functional/plugins/ml2/test_plugin.py | 2 +- .../l3_router/test_l3_dvr_ha_router_plugin.py | 2 +- .../l3_router/test_l3_dvr_router_plugin.py | 2 +- .../functional/services/trunk/test_plugin.py | 3 +- .../unit/_test_extension_portbindings.py | 2 +- neutron/tests/unit/agent/l3/test_agent.py | 2 +- .../unit/agent/l3/test_dvr_local_router.py | 2 +- .../unit/api/rpc/handlers/test_dhcp_rpc.py | 2 +- neutron/tests/unit/db/test_dvr_mac_db.py | 2 +- .../tests/unit/db/test_ipam_backend_mixin.py | 2 +- neutron/tests/unit/db/test_l3_dvr_db.py | 2 +- neutron/tests/unit/db/test_l3_hamode_db.py | 3 +- neutron/tests/unit/debug/test_commands.py | 2 +- neutron/tests/unit/extensions/test_l3.py | 2 +- neutron/tests/unit/extensions/test_segment.py | 2 +- .../unit/plugins/ml2/_test_mech_agent.py | 2 +- .../unit/plugins/ml2/drivers/l2pop/test_db.py | 2 +- .../ml2/drivers/l2pop/test_mech_driver.py | 3 +- .../mech_driver/test_mech_linuxbridge.py | 2 +- .../macvtap/mech_driver/test_mech_macvtap.py | 2 +- .../plugins/ml2/drivers/mech_fake_agent.py | 2 +- .../mech_sriov/agent/test_sriov_nic_agent.py | 2 +- .../mech_driver/test_mech_sriov_nic_switch.py | 2 +- .../plugins/ml2/drivers/mechanism_test.py | 2 +- .../mech_driver/test_mech_openvswitch.py | 2 +- neutron/tests/unit/plugins/ml2/test_db.py | 2 +- .../unit/plugins/ml2/test_driver_context.py | 2 +- neutron/tests/unit/plugins/ml2/test_plugin.py | 2 +- .../unit/plugins/ml2/test_port_binding.py | 2 +- .../unit/scheduler/test_l3_agent_scheduler.py | 2 +- .../unit/services/trunk/rpc/test_server.py | 2 +- .../tests/unit/services/trunk/test_plugin.py | 2 +- 70 files changed, 75 insertions(+), 207 deletions(-) diff --git a/doc/source/devref/contribute.rst b/doc/source/devref/contribute.rst index a9544d590f2..8f7366ca524 100644 --- a/doc/source/devref/contribute.rst +++ b/doc/source/devref/contribute.rst @@ -569,7 +569,7 @@ the installer to configure this item in the ``[default]`` section. For example:: interface_driver = networking_foo.agent.linux.interface.FooInterfaceDriver **ToDo: Interface Driver port bindings.** - ``VIF_TYPE_*`` constants in ``neutron/extensions/portbindings.py`` should be + ``VIF_TYPE_*`` constants in ``neutron_lib/api/definitions/portbindings.py`` should be moved from neutron core to the repositories where their drivers are implemented. We need to provide some config or hook mechanism for VIF types to be registered by external interface drivers. For Nova, selecting the VIF diff --git a/neutron/agent/l3/ha_router.py b/neutron/agent/l3/ha_router.py index 011a03e98ec..0ac12a946b5 100644 --- a/neutron/agent/l3/ha_router.py +++ b/neutron/agent/l3/ha_router.py @@ -17,6 +17,7 @@ import shutil import signal import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_consts from oslo_log import log as logging @@ -27,7 +28,6 @@ from neutron.agent.linux import external_process from neutron.agent.linux import ip_lib from neutron.agent.linux import keepalived from neutron.common import utils as common_utils -from neutron.extensions import portbindings LOG = logging.getLogger(__name__) HA_DEV_PREFIX = 'ha-' diff --git a/neutron/api/rpc/handlers/dhcp_rpc.py b/neutron/api/rpc/handlers/dhcp_rpc.py index e24f1ad635f..16029f3b17d 100644 --- a/neutron/api/rpc/handlers/dhcp_rpc.py +++ b/neutron/api/rpc/handlers/dhcp_rpc.py @@ -17,6 +17,7 @@ import copy import itertools import operator +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import exceptions from neutron_lib.plugins import directory @@ -33,7 +34,6 @@ from neutron.common import exceptions as n_exc from neutron.common import utils from neutron.db import api as db_api from neutron.db import provisioning_blocks -from neutron.extensions import portbindings from neutron.extensions import segment as segment_ext from neutron.plugins.common import utils as p_utils from neutron.quota import resource_registry diff --git a/neutron/api/rpc/handlers/l3_rpc.py b/neutron/api/rpc/handlers/l3_rpc.py index 079271fbb3d..e68f2ab8526 100644 --- a/neutron/api/rpc/handlers/l3_rpc.py +++ b/neutron/api/rpc/handlers/l3_rpc.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context as neutron_context from neutron_lib import exceptions @@ -26,7 +27,6 @@ from neutron.common import constants as n_const from neutron.common import utils from neutron.db import api as db_api from neutron.extensions import l3 -from neutron.extensions import portbindings LOG = logging.getLogger(__name__) diff --git a/neutron/db/dvr_mac_db.py b/neutron/db/dvr_mac_db.py index f03e17189d5..0f25617d690 100644 --- a/neutron/db/dvr_mac_db.py +++ b/neutron/db/dvr_mac_db.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory @@ -33,7 +34,6 @@ from neutron.db import api as db_api from neutron.db.models import dvr as dvr_models from neutron.db import models_v2 from neutron.extensions import dvr as ext_dvr -from neutron.extensions import portbindings LOG = logging.getLogger(__name__) diff --git a/neutron/db/ipam_backend_mixin.py b/neutron/db/ipam_backend_mixin.py index 06183cde1ea..385a6a5973f 100644 --- a/neutron/db/ipam_backend_mixin.py +++ b/neutron/db/ipam_backend_mixin.py @@ -18,6 +18,7 @@ import copy import itertools import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib.api import validators from neutron_lib import constants as const from neutron_lib import exceptions as exc @@ -38,7 +39,6 @@ from neutron.db.models import segment as segment_model from neutron.db.models import subnet_service_type as sst_model from neutron.db import models_v2 from neutron.extensions import ip_allocation as ipa -from neutron.extensions import portbindings from neutron.extensions import segment from neutron.ipam import exceptions as ipam_exceptions from neutron.ipam import utils as ipam_utils diff --git a/neutron/db/ipam_pluggable_backend.py b/neutron/db/ipam_pluggable_backend.py index 77f5268622c..d89b2a6a87d 100644 --- a/neutron/db/ipam_pluggable_backend.py +++ b/neutron/db/ipam_pluggable_backend.py @@ -16,6 +16,7 @@ import copy import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import exceptions as n_exc from oslo_db import exception as db_exc @@ -28,7 +29,6 @@ from neutron.common import constants as n_const from neutron.common import ipv6_utils from neutron.db import ipam_backend_mixin from neutron.db import models_v2 -from neutron.extensions import portbindings from neutron.ipam import driver from neutron.ipam import exceptions as ipam_exc diff --git a/neutron/db/l3_dvr_db.py b/neutron/db/l3_dvr_db.py index 4626857c5e6..38253874907 100644 --- a/neutron/db/l3_dvr_db.py +++ b/neutron/db/l3_dvr_db.py @@ -13,6 +13,7 @@ # under the License. import collections +from neutron_lib.api.definitions import portbindings from neutron_lib.api import validators from neutron_lib import constants as const from neutron_lib import exceptions as n_exc @@ -38,7 +39,6 @@ from neutron.db.models import l3 as l3_models from neutron.db.models import l3agent as rb_model from neutron.db import models_v2 from neutron.extensions import l3 -from neutron.extensions import portbindings from neutron.ipam import utils as ipam_utils from neutron.plugins.common import utils as p_utils diff --git a/neutron/db/l3_dvrscheduler_db.py b/neutron/db/l3_dvrscheduler_db.py index 04adc6c0779..83991549147 100644 --- a/neutron/db/l3_dvrscheduler_db.py +++ b/neutron/db/l3_dvrscheduler_db.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_const from neutron_lib.plugins import directory from oslo_log import log as logging @@ -27,7 +28,6 @@ from neutron.db import agentschedulers_db from neutron.db import l3_agentschedulers_db as l3agent_sch_db from neutron.db.models import l3agent as rb_model from neutron.db import models_v2 -from neutron.extensions import portbindings from neutron.plugins.ml2 import db as ml2_db from neutron.plugins.ml2 import models as ml2_models diff --git a/neutron/db/l3_hamode_db.py b/neutron/db/l3_hamode_db.py index 04384c48030..1dcb17ea5b4 100644 --- a/neutron/db/l3_hamode_db.py +++ b/neutron/db/l3_hamode_db.py @@ -16,6 +16,7 @@ import functools import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as providernet from neutron_lib.api import validators from neutron_lib import constants @@ -48,7 +49,6 @@ from neutron.db.models import l3_attrs from neutron.db.models import l3ha as l3ha_model from neutron.extensions import l3 from neutron.extensions import l3_ext_ha_mode as l3_ha -from neutron.extensions import portbindings from neutron.plugins.common import utils as p_utils diff --git a/neutron/db/l3_hascheduler_db.py b/neutron/db/l3_hascheduler_db.py index 1772722f298..93e5eb73c6a 100644 --- a/neutron/db/l3_hascheduler_db.py +++ b/neutron/db/l3_hascheduler_db.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib.plugins import directory from sqlalchemy import func @@ -22,7 +23,6 @@ from neutron.callbacks import resources from neutron.db import l3_agentschedulers_db as l3_sch_db from neutron.db.models import agent as agent_model from neutron.db.models import l3agent as rb_model -from neutron.extensions import portbindings class L3_HA_scheduler_db_mixin(l3_sch_db.AZL3AgentSchedulerDbMixin): diff --git a/neutron/db/portbindings_db.py b/neutron/db/portbindings_db.py index fe79d4b297e..1bb43351c7f 100644 --- a/neutron/db/portbindings_db.py +++ b/neutron/db/portbindings_db.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib.api import validators from neutron.api.v2 import attributes @@ -21,7 +22,6 @@ from neutron.db import _resource_extend as resource_extend from neutron.db.models import portbinding as pmodels from neutron.db import models_v2 from neutron.db import portbindings_base -from neutron.extensions import portbindings class PortBindingMixin(portbindings_base.PortBindingBaseMixin): diff --git a/neutron/debug/debug_agent.py b/neutron/debug/debug_agent.py index e1a564aa935..07f7b182d4d 100644 --- a/neutron/debug/debug_agent.py +++ b/neutron/debug/debug_agent.py @@ -17,13 +17,13 @@ import shlex import socket import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_log import log as logging from neutron._i18n import _LW from neutron.agent.linux import dhcp from neutron.agent.linux import ip_lib -from neutron.extensions import portbindings LOG = logging.getLogger(__name__) diff --git a/neutron/extensions/portbindings.py b/neutron/extensions/portbindings.py index 00cfe129a70..df5af4afd3e 100644 --- a/neutron/extensions/portbindings.py +++ b/neutron/extensions/portbindings.py @@ -13,126 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib.api import extensions -from neutron_lib import constants -# The type of vnic that this port should be attached to -VNIC_TYPE = 'binding:vnic_type' -# The service will return the vif type for the specific port. -VIF_TYPE = 'binding:vif_type' -# The service may return a dictionary containing additional -# information needed by the interface driver. The set of items -# returned may depend on the value of VIF_TYPE. -VIF_DETAILS = 'binding:vif_details' -# In some cases different implementations may be run on different hosts. -# The host on which the port will be allocated. -HOST_ID = 'binding:host_id' -# The profile will be a dictionary that enables the application running -# on the specific host to pass and receive vif port specific information to -# the plugin. -PROFILE = 'binding:profile' - -# The keys below are used in the VIF_DETAILS attribute to convey -# information to the VIF driver. - -# TODO(rkukura): Replace CAP_PORT_FILTER, which nova no longer -# understands, with the new set of VIF security details to be used in -# the VIF_DETAILS attribute. -# -# - port_filter : Boolean value indicating Neutron provides port filtering -# features such as security group and anti MAC/IP spoofing -# - ovs_hybrid_plug: Boolean used to inform Nova that the hybrid plugging -# strategy for OVS should be used -CAP_PORT_FILTER = 'port_filter' -OVS_HYBRID_PLUG = 'ovs_hybrid_plug' -VIF_DETAILS_VLAN = 'vlan' -VIF_DETAILS_MACVTAP_SOURCE = 'macvtap_source' -VIF_DETAILS_MACVTAP_MODE = 'macvtap_mode' -VIF_DETAILS_PHYSICAL_INTERFACE = 'physical_interface' -VIF_DETAILS_BRIDGE_NAME = 'bridge_name' - -# The keys below are used in the VIF_DETAILS attribute to convey -# information related to the configuration of the vhost-user VIF driver. - -# - vhost_user_mode: String value used to declare the mode of a -# vhost-user socket -VHOST_USER_MODE = 'vhostuser_mode' -# - server: socket created by hypervisor -VHOST_USER_MODE_SERVER = 'server' -# - client: socket created by vswitch -VHOST_USER_MODE_CLIENT = 'client' -# - vhostuser_socket String value used to declare the vhostuser socket name -VHOST_USER_SOCKET = 'vhostuser_socket' -# - vhost_user_ovs_plug: Boolean used to inform Nova that the ovs plug -# method should be used when binding the -# vhost-user vif. -VHOST_USER_OVS_PLUG = 'vhostuser_ovs_plug' - -# VIF_TYPE: vif_types are required by Nova to determine which vif_driver to -# use to attach a virtual server to the network - -# - vhost-user: The vhost-user interface type is a standard virtio interface -# provided by qemu 2.1+. This constant defines the neutron side -# of the vif binding type to provide a common definition -# to enable reuse in multiple agents and drivers. -VIF_TYPE_VHOST_USER = 'vhostuser' - -VIF_TYPE_UNBOUND = 'unbound' -VIF_TYPE_BINDING_FAILED = 'binding_failed' -VIF_TYPE_DISTRIBUTED = 'distributed' -VIF_TYPE_OVS = 'ovs' -VIF_TYPE_BRIDGE = 'bridge' -VIF_TYPE_OTHER = 'other' -# vif_type_macvtap: Tells Nova that the macvtap vif_driver should be used to -# create a vif. It does not require the VNIC_TYPE_MACVTAP, -# which is defined further below. E.g. Macvtap agent uses -# vnic_type 'normal'. -VIF_TYPE_MACVTAP = 'macvtap' -# SR-IOV VIF types -VIF_TYPE_HW_VEB = 'hw_veb' -VIF_TYPE_HOSTDEV_PHY = 'hostdev_physical' - -# VNIC_TYPE: It's used to determine which mechanism driver to use to bind a -# port. It can be specified via the Neutron API. Default is normal, -# used by OVS and LinuxBridge agent. -VNIC_NORMAL = 'normal' -VNIC_DIRECT = 'direct' -VNIC_MACVTAP = 'macvtap' -VNIC_BAREMETAL = 'baremetal' -VNIC_DIRECT_PHYSICAL = 'direct-physical' -VNIC_TYPES = [VNIC_NORMAL, VNIC_DIRECT, VNIC_MACVTAP, VNIC_BAREMETAL, - VNIC_DIRECT_PHYSICAL] - -EXTENDED_ATTRIBUTES_2_0 = { - 'ports': { - VIF_TYPE: {'allow_post': False, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - VIF_DETAILS: {'allow_post': False, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - VNIC_TYPE: {'allow_post': True, 'allow_put': True, - 'default': VNIC_NORMAL, - 'is_visible': True, - 'validate': {'type:values': VNIC_TYPES}, - 'enforce_policy': True}, - HOST_ID: {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True, - 'enforce_policy': True}, - PROFILE: {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'validate': {'type:dict_or_none': None}, - 'is_visible': True}, - } -} - - -class Portbindings(extensions.ExtensionDescriptor): +class Portbindings(extensions.APIExtensionDescriptor): """Extension class supporting port bindings. This class is used by neutron's extension framework to make @@ -141,24 +26,4 @@ class Portbindings(extensions.ExtensionDescriptor): With admin rights one will be able to update and read the values. """ - @classmethod - def get_name(cls): - return "Port Binding" - - @classmethod - def get_alias(cls): - return "binding" - - @classmethod - def get_description(cls): - return "Expose port bindings of a virtual port to external application" - - @classmethod - def get_updated(cls): - return "2014-02-03T10:00:00-00:00" - - def get_extended_resources(self, version): - if version == "2.0": - return EXTENDED_ATTRIBUTES_2_0 - else: - return {} + api_definition = portbindings diff --git a/neutron/plugins/ml2/db.py b/neutron/plugins/ml2/db.py index ca9ccfdfd12..f5d7a0f7442 100644 --- a/neutron/plugins/ml2/db.py +++ b/neutron/plugins/ml2/db.py @@ -14,6 +14,7 @@ # under the License. from debtcollector import removals +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_const from neutron_lib.plugins import directory from oslo_db import exception as db_exc @@ -29,7 +30,6 @@ from neutron.callbacks import registry from neutron.callbacks import resources from neutron.db.models import securitygroup as sg_models from neutron.db import models_v2 -from neutron.extensions import portbindings from neutron.objects import ports as port_obj from neutron.plugins.ml2 import models from neutron.services.segments import exceptions as seg_exc diff --git a/neutron/plugins/ml2/driver_context.py b/neutron/plugins/ml2/driver_context.py index 565b92e7224..1286ccf48a2 100644 --- a/neutron/plugins/ml2/driver_context.py +++ b/neutron/plugins/ml2/driver_context.py @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_log import log from oslo_serialization import jsonutils from neutron._i18n import _LW from neutron.db import segments_db -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) diff --git a/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py b/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py index 4d60a186461..d22eca5e6fb 100644 --- a/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py +++ b/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron.agent import securitygroups_rpc -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2.drivers import mech_agent from neutron.services.qos.drivers.linuxbridge import driver as lb_qos_driver diff --git a/neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py b/neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py index f578e8bf9e1..309cbb3b4b0 100644 --- a/neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py +++ b/neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py @@ -15,10 +15,10 @@ # under the License. from neutron._i18n import _LE +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_log import log -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers.macvtap import macvtap_common diff --git a/neutron/plugins/ml2/drivers/mech_agent.py b/neutron/plugins/ml2/drivers/mech_agent.py index 30e64374a3a..09efa3bed7d 100644 --- a/neutron/plugins/ml2/drivers/mech_agent.py +++ b/neutron/plugins/ml2/drivers/mech_agent.py @@ -15,6 +15,7 @@ import abc +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as const from oslo_log import log import six @@ -22,7 +23,6 @@ import six from neutron._i18n import _LW from neutron.callbacks import resources from neutron.db import provisioning_blocks -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2 import driver_api as api diff --git a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py index 1625f74f7e9..3e3cd7abfc7 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py @@ -20,6 +20,7 @@ import socket import sys import time +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_constants from neutron_lib import context from neutron_lib.utils import helpers @@ -39,7 +40,6 @@ from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc from neutron.common import config as common_config from neutron.common import profiler as setup_profiler from neutron.common import topics -from neutron.extensions import portbindings from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config from neutron.plugins.ml2.drivers.mech_sriov.agent.common \ import exceptions as exc diff --git a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py index 61b78d041f5..3ee731aaea9 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_log import log from neutron._i18n import _LW -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_const from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers import mech_agent diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index 0955bdca061..75e886aa8f0 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -22,6 +22,7 @@ import sys import time import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_const from neutron_lib import context from neutron_lib.utils import helpers @@ -54,7 +55,6 @@ from neutron.common import config from neutron.common import constants as c_const from neutron.common import topics from neutron.conf.agent import xenapi_conf -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_const from neutron.plugins.common import utils as p_utils from neutron.plugins.ml2.drivers.agent import capabilities diff --git a/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py b/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py index 7df8b7d4345..bed74fcc84e 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py +++ b/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py @@ -15,13 +15,13 @@ import os +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_config import cfg from neutron.agent import securitygroups_rpc from neutron.callbacks import events from neutron.callbacks import registry -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers import mech_agent diff --git a/neutron/plugins/ml2/managers.py b/neutron/plugins/ml2/managers.py index 7f0652d91fc..b2f9db74db5 100644 --- a/neutron/plugins/ml2/managers.py +++ b/neutron/plugins/ml2/managers.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as provider from neutron_lib.api import validators from neutron_lib import constants @@ -28,7 +29,6 @@ from neutron.db import api as db_api from neutron.db import segments_db from neutron.extensions import external_net from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import portbindings from neutron.extensions import vlantransparent from neutron.plugins.ml2.common import exceptions as ml2_exc from neutron.plugins.ml2 import driver_api as api diff --git a/neutron/plugins/ml2/models.py b/neutron/plugins/ml2/models.py index 45e9ffc3d07..9cf603e35f6 100644 --- a/neutron/plugins/ml2/models.py +++ b/neutron/plugins/ml2/models.py @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib.db import model_base import sqlalchemy as sa from sqlalchemy import orm from neutron.common import constants from neutron.db import models_v2 -from neutron.extensions import portbindings BINDING_PROFILE_LEN = 4095 diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 896a0d72d25..40f33f10e71 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -14,6 +14,7 @@ # under the License. from eventlet import greenthread +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net from neutron_lib.api import validators from neutron_lib import constants as const @@ -71,7 +72,6 @@ from neutron.extensions import allowedaddresspairs as addr_pair from neutron.extensions import availability_zone as az_ext from neutron.extensions import extra_dhcp_opt as edo_ext from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import portbindings from neutron.extensions import portsecurity as psec from neutron.extensions import providernet as provider from neutron.extensions import vlantransparent diff --git a/neutron/plugins/ml2/rpc.py b/neutron/plugins/ml2/rpc.py index 9ef7ab64d7c..ddceb4f9a91 100644 --- a/neutron/plugins/ml2/rpc.py +++ b/neutron/plugins/ml2/rpc.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_const from neutron_lib import exceptions from neutron_lib.plugins import directory @@ -28,7 +29,6 @@ from neutron.common import rpc as n_rpc from neutron.common import topics from neutron.db import l3_hamode_db from neutron.db import provisioning_blocks -from neutron.extensions import portbindings from neutron.extensions import portsecurity as psec from neutron.plugins.ml2 import db as ml2_db from neutron.plugins.ml2 import driver_api as api diff --git a/neutron/services/qos/drivers/linuxbridge/driver.py b/neutron/services/qos/drivers/linuxbridge/driver.py index c23feb49a9d..6ac31e1307b 100644 --- a/neutron/services/qos/drivers/linuxbridge/driver.py +++ b/neutron/services/qos/drivers/linuxbridge/driver.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from oslo_log import log as logging -from neutron.extensions import portbindings from neutron.services.qos.drivers import base from neutron.services.qos import qos_consts diff --git a/neutron/services/qos/drivers/openvswitch/driver.py b/neutron/services/qos/drivers/openvswitch/driver.py index 469eb542f49..9ef67f0d53f 100644 --- a/neutron/services/qos/drivers/openvswitch/driver.py +++ b/neutron/services/qos/drivers/openvswitch/driver.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from oslo_log import log as logging -from neutron.extensions import portbindings from neutron.services.qos.drivers import base from neutron.services.qos import qos_consts diff --git a/neutron/services/qos/drivers/sriov/driver.py b/neutron/services/qos/drivers/sriov/driver.py index ac5418c7a24..b4fdeb1e9f9 100644 --- a/neutron/services/qos/drivers/sriov/driver.py +++ b/neutron/services/qos/drivers/sriov/driver.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from oslo_log import log as logging -from neutron.extensions import portbindings from neutron.services.qos.drivers import base from neutron.services.qos import qos_consts diff --git a/neutron/services/trunk/drivers/linuxbridge/driver.py b/neutron/services/trunk/drivers/linuxbridge/driver.py index fd982e14468..3cf149431fa 100644 --- a/neutron/services/trunk/drivers/linuxbridge/driver.py +++ b/neutron/services/trunk/drivers/linuxbridge/driver.py @@ -13,9 +13,9 @@ from oslo_config import cfg from oslo_log import log as logging +from neutron_lib.api.definitions import portbindings from neutron_lib import constants -from neutron.extensions import portbindings from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk.drivers import base diff --git a/neutron/services/trunk/drivers/openvswitch/driver.py b/neutron/services/trunk/drivers/openvswitch/driver.py index b4b0ab87ee2..cd8c3be8aea 100644 --- a/neutron/services/trunk/drivers/openvswitch/driver.py +++ b/neutron/services/trunk/drivers/openvswitch/driver.py @@ -11,13 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_config import cfg from oslo_log import log as logging from neutron.callbacks import events from neutron.callbacks import registry -from neutron.extensions import portbindings from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( constants as agent_consts) from neutron.services.trunk import constants as trunk_consts diff --git a/neutron/services/trunk/plugin.py b/neutron/services/trunk/plugin.py index 7b21f24eb69..75e57eef0e9 100644 --- a/neutron/services/trunk/plugin.py +++ b/neutron/services/trunk/plugin.py @@ -14,6 +14,7 @@ import copy +from neutron_lib.api.definitions import portbindings from neutron_lib import context from neutron_lib.services import base as service_base from oslo_log import log as logging @@ -27,7 +28,6 @@ from neutron.db import _resource_extend as resource_extend from neutron.db import api as db_api from neutron.db import common_db_mixin from neutron.db import db_base_plugin_common -from neutron.extensions import portbindings from neutron.objects import base as objects_base from neutron.objects import trunk as trunk_objects from neutron.services.trunk import callbacks diff --git a/neutron/services/trunk/rpc/server.py b/neutron/services/trunk/rpc/server.py index 7441721fff8..efa85454ef5 100644 --- a/neutron/services/trunk/rpc/server.py +++ b/neutron/services/trunk/rpc/server.py @@ -14,6 +14,7 @@ import collections +from neutron_lib.api.definitions import portbindings from neutron_lib.plugins import directory from oslo_log import helpers as log_helpers from oslo_log import log as logging @@ -26,7 +27,6 @@ from neutron.api.rpc.callbacks import resources from neutron.api.rpc.handlers import resources_rpc from neutron.common import rpc as n_rpc from neutron.db import api as db_api -from neutron.extensions import portbindings from neutron.objects import trunk as trunk_objects from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk import exceptions as trunk_exc diff --git a/neutron/services/trunk/rules.py b/neutron/services/trunk/rules.py index 689c453818d..d6a9c91d7e3 100644 --- a/neutron/services/trunk/rules.py +++ b/neutron/services/trunk/rules.py @@ -13,13 +13,13 @@ # under the License. from neutron_lib.api import converters +from neutron_lib.api.definitions import portbindings from neutron_lib.api import validators from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory from neutron._i18n import _ from neutron.common import utils as n_utils -from neutron.extensions import portbindings from neutron.objects import trunk as trunk_objects from neutron.plugins.ml2 import driver_api as api from neutron.services.trunk import exceptions as trunk_exc diff --git a/neutron/tests/fullstack/resources/client.py b/neutron/tests/fullstack/resources/client.py index dc07b8f2b0a..a77cf3a4f9f 100644 --- a/neutron/tests/fullstack/resources/client.py +++ b/neutron/tests/fullstack/resources/client.py @@ -16,11 +16,11 @@ import functools import netaddr import fixtures +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutronclient.common import exceptions from neutron.common import utils -from neutron.extensions import portbindings def _safe_method(f): diff --git a/neutron/tests/fullstack/resources/machine.py b/neutron/tests/fullstack/resources/machine.py index 58afd24a993..ff5cb08b40e 100644 --- a/neutron/tests/fullstack/resources/machine.py +++ b/neutron/tests/fullstack/resources/machine.py @@ -16,12 +16,12 @@ import itertools import netaddr +from neutron_lib.api.definitions import portbindings as pbs from neutron_lib import constants from neutron.agent.linux import async_process from neutron.agent.linux import ip_lib from neutron.common import utils -from neutron.extensions import portbindings as pbs from neutron.tests.common import machine_fixtures from neutron.tests.common import net_helpers diff --git a/neutron/tests/functional/agent/l3/test_dvr_router.py b/neutron/tests/functional/agent/l3/test_dvr_router.py index 86d0e058115..cb3216be40e 100644 --- a/neutron/tests/functional/agent/l3/test_dvr_router.py +++ b/neutron/tests/functional/agent/l3/test_dvr_router.py @@ -18,6 +18,7 @@ import functools import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as lib_constants import testtools @@ -30,7 +31,6 @@ from neutron.agent.linux import iptables_manager from neutron.common import constants as n_const from neutron.common import exceptions as n_exc from neutron.common import utils -from neutron.extensions import portbindings from neutron.tests.common import l3_test_common from neutron.tests.common import machine_fixtures from neutron.tests.common import net_helpers diff --git a/neutron/tests/functional/plugins/ml2/test_plugin.py b/neutron/tests/functional/plugins/ml2/test_plugin.py index e14584e31e1..548258fe47a 100644 --- a/neutron/tests/functional/plugins/ml2/test_plugin.py +++ b/neutron/tests/functional/plugins/ml2/test_plugin.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context from neutron.db import agents_db -from neutron.extensions import portbindings from neutron.tests.common import helpers from neutron.tests.unit.plugins.ml2 import base as ml2_test_base diff --git a/neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py b/neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py index 1bb638b58a9..f5bb9f48e0d 100644 --- a/neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py +++ b/neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py @@ -13,12 +13,12 @@ # under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron.common import topics from neutron.extensions import external_net from neutron.extensions import l3 -from neutron.extensions import portbindings from neutron.tests.common import helpers from neutron.tests.functional.services.l3_router import \ test_l3_dvr_router_plugin diff --git a/neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py b/neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py index a5f761f4775..dba4c20613d 100644 --- a/neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py +++ b/neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py @@ -13,6 +13,7 @@ # under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context @@ -23,7 +24,6 @@ from neutron.callbacks import resources from neutron.common import topics from neutron.extensions import external_net from neutron.extensions import l3 -from neutron.extensions import portbindings from neutron.tests.common import helpers from neutron.tests.unit.plugins.ml2 import base as ml2_test_base diff --git a/neutron/tests/functional/services/trunk/test_plugin.py b/neutron/tests/functional/services/trunk/test_plugin.py index beb2f384d47..c124ef6c025 100644 --- a/neutron/tests/functional/services/trunk/test_plugin.py +++ b/neutron/tests/functional/services/trunk/test_plugin.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.extensions import portbindings as pb +from neutron_lib.api.definitions import portbindings as pb + from neutron.services.trunk.drivers.openvswitch import utils from neutron.services.trunk import plugin as trunk_plugin from neutron.tests.common import helpers diff --git a/neutron/tests/unit/_test_extension_portbindings.py b/neutron/tests/unit/_test_extension_portbindings.py index 22314ae5db6..b3f219f35b5 100644 --- a/neutron/tests/unit/_test_extension_portbindings.py +++ b/neutron/tests/unit/_test_extension_portbindings.py @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import context from neutron_lib.plugins import directory from oslo_config import cfg from six.moves import http_client as httplib from webob import exc -from neutron.extensions import portbindings from neutron.tests.unit.db import test_db_base_plugin_v2 diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index d70a3055322..8d478aa1eaf 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -20,6 +20,7 @@ from itertools import combinations as iter_combinations import eventlet import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as lib_constants from neutron_lib import exceptions as exc from oslo_config import cfg @@ -52,7 +53,6 @@ from neutron.conf.agent import common as agent_config from neutron.conf.agent.l3 import config as l3_config from neutron.conf.agent.l3 import ha as ha_conf from neutron.conf import common as base_config -from neutron.extensions import portbindings from neutron.tests import base from neutron.tests.common import l3_test_common diff --git a/neutron/tests/unit/agent/l3/test_dvr_local_router.py b/neutron/tests/unit/agent/l3/test_dvr_local_router.py index 6e6291afc34..35ab22498c5 100644 --- a/neutron/tests/unit/agent/l3/test_dvr_local_router.py +++ b/neutron/tests/unit/agent/l3/test_dvr_local_router.py @@ -14,6 +14,7 @@ import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as lib_constants from oslo_config import cfg from oslo_log import log @@ -32,7 +33,6 @@ from neutron.conf.agent import common as agent_config from neutron.conf.agent.l3 import config as l3_config from neutron.conf.agent.l3 import ha as ha_conf from neutron.conf import common as base_config -from neutron.extensions import portbindings from neutron.tests import base from neutron.tests.common import l3_test_common diff --git a/neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py b/neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py index fc9955710ee..bf5ede302a7 100644 --- a/neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py +++ b/neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py @@ -14,6 +14,7 @@ # limitations under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory @@ -25,7 +26,6 @@ from neutron.common import constants as n_const from neutron.common import exceptions from neutron.common import utils from neutron.db import provisioning_blocks -from neutron.extensions import portbindings from neutron.tests import base diff --git a/neutron/tests/unit/db/test_dvr_mac_db.py b/neutron/tests/unit/db/test_dvr_mac_db.py index 1dcb324d369..341486e4a13 100644 --- a/neutron/tests/unit/db/test_dvr_mac_db.py +++ b/neutron/tests/unit/db/test_dvr_mac_db.py @@ -14,6 +14,7 @@ # limitations under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context from neutron_lib.plugins import directory @@ -25,7 +26,6 @@ from neutron.db import api as db_api from neutron.db import dvr_mac_db from neutron.db.models import dvr as dvr_models from neutron.extensions import dvr -from neutron.extensions import portbindings from neutron.tests.unit.plugins.ml2 import test_plugin diff --git a/neutron/tests/unit/db/test_ipam_backend_mixin.py b/neutron/tests/unit/db/test_ipam_backend_mixin.py index 81f4620bbf9..ac3b5af9926 100644 --- a/neutron/tests/unit/db/test_ipam_backend_mixin.py +++ b/neutron/tests/unit/db/test_ipam_backend_mixin.py @@ -15,13 +15,13 @@ import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants import webob.exc from neutron.db import db_base_plugin_v2 from neutron.db import ipam_backend_mixin from neutron.db import portbindings_db -from neutron.extensions import portbindings from neutron.tests import base from neutron.tests.unit.db import test_db_base_plugin_v2 diff --git a/neutron/tests/unit/db/test_l3_dvr_db.py b/neutron/tests/unit/db/test_l3_dvr_db.py index 7ba7fba3b3b..88c5966b429 100644 --- a/neutron/tests/unit/db/test_l3_dvr_db.py +++ b/neutron/tests/unit/db/test_l3_dvr_db.py @@ -14,6 +14,7 @@ # limitations under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as const from neutron_lib import context from neutron_lib import exceptions @@ -29,7 +30,6 @@ from neutron.db import common_db_mixin from neutron.db import l3_agentschedulers_db from neutron.db import l3_dvr_db from neutron.extensions import l3 -from neutron.extensions import portbindings from neutron.tests.unit.db import test_db_base_plugin_v2 _uuid = uuidutils.generate_uuid diff --git a/neutron/tests/unit/db/test_l3_hamode_db.py b/neutron/tests/unit/db/test_l3_hamode_db.py index 3eaddd3ba34..ff0113700d0 100644 --- a/neutron/tests/unit/db/test_l3_hamode_db.py +++ b/neutron/tests/unit/db/test_l3_hamode_db.py @@ -13,6 +13,8 @@ # under the License. import mock + +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as providernet from neutron_lib import constants from neutron_lib import context @@ -40,7 +42,6 @@ from neutron.db.models import l3ha as l3ha_model from neutron.extensions import external_net from neutron.extensions import l3 from neutron.extensions import l3_ext_ha_mode -from neutron.extensions import portbindings from neutron.scheduler import l3_agent_scheduler from neutron.services.revisions import revision_plugin from neutron.tests.common import helpers diff --git a/neutron/tests/unit/debug/test_commands.py b/neutron/tests/unit/debug/test_commands.py index 2876f503994..fa0260aa263 100644 --- a/neutron/tests/unit/debug/test_commands.py +++ b/neutron/tests/unit/debug/test_commands.py @@ -16,6 +16,7 @@ import socket import mock +from neutron_lib.api.definitions import portbindings from oslo_config import cfg from neutron.agent.linux import interface @@ -23,7 +24,6 @@ from neutron.common import config as common_config from neutron.conf.agent import common as config from neutron.debug import commands from neutron.debug import debug_agent -from neutron.extensions import portbindings from neutron.tests import base diff --git a/neutron/tests/unit/extensions/test_l3.py b/neutron/tests/unit/extensions/test_l3.py index c0f4973af11..eccd6ee2302 100644 --- a/neutron/tests/unit/extensions/test_l3.py +++ b/neutron/tests/unit/extensions/test_l3.py @@ -19,6 +19,7 @@ import copy import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as lib_constants from neutron_lib import context from neutron_lib import exceptions as n_exc @@ -53,7 +54,6 @@ from neutron.db import models_v2 from neutron.extensions import dns from neutron.extensions import external_net from neutron.extensions import l3 -from neutron.extensions import portbindings from neutron.plugins.ml2 import config from neutron.services.revisions import revision_plugin from neutron.tests import base diff --git a/neutron/tests/unit/extensions/test_segment.py b/neutron/tests/unit/extensions/test_segment.py index ee287927fa3..459817ad3e2 100644 --- a/neutron/tests/unit/extensions/test_segment.py +++ b/neutron/tests/unit/extensions/test_segment.py @@ -17,6 +17,7 @@ from keystoneauth1 import exceptions as ks_exc import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context from neutron_lib import exceptions as n_exc @@ -40,7 +41,6 @@ from neutron.db import portbindings_db from neutron.db import segments_db from neutron.extensions import ip_allocation from neutron.extensions import l2_adjacency -from neutron.extensions import portbindings from neutron.extensions import segment as ext_segment from neutron.objects import network from neutron.plugins.common import constants as p_constants diff --git a/neutron/tests/unit/plugins/ml2/_test_mech_agent.py b/neutron/tests/unit/plugins/ml2/_test_mech_agent.py index addfb67f950..5285089d392 100644 --- a/neutron/tests/unit/plugins/ml2/_test_mech_agent.py +++ b/neutron/tests/unit/plugins/ml2/_test_mech_agent.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api from neutron.tests import base diff --git a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py index cceacfff176..f396300062c 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py +++ b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context from neutron_lib.utils import net @@ -22,7 +23,6 @@ from neutron.db.models import l3 as l3_models from neutron.db.models import l3_attrs from neutron.db.models import l3ha as l3ha_model from neutron.db import models_v2 -from neutron.extensions import portbindings from neutron.objects import network as network_obj from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db from neutron.plugins.ml2 import models diff --git a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py index 52128da7776..f7bb64b2646 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py +++ b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py @@ -14,6 +14,8 @@ # under the License. import mock + +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants from neutron_lib import context @@ -29,7 +31,6 @@ from neutron.db import agents_db from neutron.db import common_db_mixin from neutron.db import l3_agentschedulers_db from neutron.db import l3_hamode_db -from neutron.extensions import portbindings from neutron.plugins.ml2 import db as ml2_db from neutron.plugins.ml2 import driver_context from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db diff --git a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py index 22b854b0277..27746f65117 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py +++ b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants -from neutron.extensions import portbindings from neutron.plugins.ml2.drivers.linuxbridge.mech_driver \ import mech_linuxbridge from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base diff --git a/neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py b/neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py index 0c5c30cddfc..535e7a210ca 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py +++ b/neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers.macvtap.mech_driver import mech_macvtap from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base diff --git a/neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py b/neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py index bd3a02a76c6..aa07445a58e 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py @@ -20,10 +20,10 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron.agent import securitygroups_rpc -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2.drivers import mech_agent diff --git a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py index f7e8b500b18..e6e83f544dd 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py @@ -15,12 +15,12 @@ import mock +from neutron_lib.api.definitions import portbindings from oslo_config import cfg from oslo_utils import uuidutils from neutron.agent.l2 import l2_agent_extensions_manager as l2_ext_manager from neutron.agent import rpc as agent_rpc -from neutron.extensions import portbindings from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config # noqa from neutron.plugins.ml2.drivers.mech_sriov.agent.common import exceptions from neutron.plugins.ml2.drivers.mech_sriov.agent import sriov_nic_agent diff --git a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py index 3d9b20ae605..227e7aa8e00 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py +++ b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py @@ -13,10 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants import testtools -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_const from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers.mech_sriov.mech_driver \ diff --git a/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py b/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py index e7c33caf0c3..678a69117ed 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py +++ b/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as const -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py index f9555f69757..c8b8595ba5b 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py @@ -13,12 +13,12 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from oslo_config import cfg from neutron.callbacks import events from neutron.callbacks import registry -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( constants as a_const) diff --git a/neutron/tests/unit/plugins/ml2/test_db.py b/neutron/tests/unit/plugins/ml2/test_db.py index 3423cb9dbd7..3f04921826f 100644 --- a/neutron/tests/unit/plugins/ml2/test_db.py +++ b/neutron/tests/unit/plugins/ml2/test_db.py @@ -17,6 +17,7 @@ import warnings import mock import netaddr +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context from oslo_utils import uuidutils @@ -27,7 +28,6 @@ from neutron.db import db_base_plugin_v2 from neutron.db.models import l3 as l3_models from neutron.db import models_v2 from neutron.db import segments_db -from neutron.extensions import portbindings from neutron.objects import network as network_obj from neutron.objects import ports as port_obj from neutron.plugins.ml2 import db as ml2_db diff --git a/neutron/tests/unit/plugins/ml2/test_driver_context.py b/neutron/tests/unit/plugins/ml2/test_driver_context.py index 1ab5a2ad318..202763c02f9 100644 --- a/neutron/tests/unit/plugins/ml2/test_driver_context.py +++ b/neutron/tests/unit/plugins/ml2/test_driver_context.py @@ -14,9 +14,9 @@ # under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants -from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_context from neutron.tests import base diff --git a/neutron/tests/unit/plugins/ml2/test_plugin.py b/neutron/tests/unit/plugins/ml2/test_plugin.py index 0abc4bb0007..495ecb18a2f 100644 --- a/neutron/tests/unit/plugins/ml2/test_plugin.py +++ b/neutron/tests/unit/plugins/ml2/test_plugin.py @@ -21,6 +21,7 @@ import six import testtools import webob +from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants from neutron_lib import context @@ -44,7 +45,6 @@ from neutron.db import segments_db from neutron.extensions import availability_zone as az_ext from neutron.extensions import external_net from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import portbindings from neutron.plugins.common import constants as p_const from neutron.plugins.ml2.common import exceptions as ml2_exc from neutron.plugins.ml2 import config diff --git a/neutron/tests/unit/plugins/ml2/test_port_binding.py b/neutron/tests/unit/plugins/ml2/test_port_binding.py index ede0c634acd..f7731042d2c 100644 --- a/neutron/tests/unit/plugins/ml2/test_port_binding.py +++ b/neutron/tests/unit/plugins/ml2/test_port_binding.py @@ -14,12 +14,12 @@ # under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants as const from neutron_lib import context from neutron_lib.plugins import directory from neutron.conf.plugins.ml2.drivers import driver_type -from neutron.extensions import portbindings from neutron.plugins.ml2 import config from neutron.plugins.ml2 import driver_context from neutron.plugins.ml2 import models as ml2_models diff --git a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py index e2ce55bbebf..0531389e21b 100644 --- a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py +++ b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py @@ -18,6 +18,7 @@ import contextlib import datetime import mock +from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib import context as n_context from neutron_lib.plugins import directory @@ -40,7 +41,6 @@ from neutron.db.models import l3agent as rb_model from neutron.db.models import l3ha as l3ha_model from neutron.extensions import l3 from neutron.extensions import l3agentscheduler as l3agent -from neutron.extensions import portbindings from neutron import manager from neutron.scheduler import l3_agent_scheduler from neutron.tests import base diff --git a/neutron/tests/unit/services/trunk/rpc/test_server.py b/neutron/tests/unit/services/trunk/rpc/test_server.py index 141ed4cade2..e94a04ecf55 100644 --- a/neutron/tests/unit/services/trunk/rpc/test_server.py +++ b/neutron/tests/unit/services/trunk/rpc/test_server.py @@ -12,6 +12,7 @@ # under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib.plugins import directory from oslo_config import cfg import oslo_messaging @@ -19,7 +20,6 @@ import oslo_messaging from neutron.api.rpc.callbacks import events from neutron.api.rpc.callbacks import resources from neutron.api.rpc.handlers import resources_rpc -from neutron.extensions import portbindings from neutron.objects import trunk as trunk_obj from neutron.plugins.ml2 import plugin as ml2_plugin from neutron.services.trunk import constants diff --git a/neutron/tests/unit/services/trunk/test_plugin.py b/neutron/tests/unit/services/trunk/test_plugin.py index d4b550485b3..bc17ae605e6 100644 --- a/neutron/tests/unit/services/trunk/test_plugin.py +++ b/neutron/tests/unit/services/trunk/test_plugin.py @@ -14,13 +14,13 @@ # limitations under the License. import mock +from neutron_lib.api.definitions import portbindings from neutron_lib.plugins import directory import testtools from neutron.callbacks import events from neutron.callbacks import registry from neutron.callbacks import resources -from neutron.extensions import portbindings from neutron.objects import trunk as trunk_objects from neutron.services.trunk import callbacks from neutron.services.trunk import constants