Browse Source

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
changes/10/422210/15
Boden R 5 years ago
parent
commit
7bd521e7ce
  1. 2
      doc/source/devref/contribute.rst
  2. 2
      neutron/agent/l3/ha_router.py
  3. 2
      neutron/api/rpc/handlers/dhcp_rpc.py
  4. 2
      neutron/api/rpc/handlers/l3_rpc.py
  5. 2
      neutron/db/dvr_mac_db.py
  6. 2
      neutron/db/ipam_backend_mixin.py
  7. 2
      neutron/db/ipam_pluggable_backend.py
  8. 2
      neutron/db/l3_dvr_db.py
  9. 2
      neutron/db/l3_dvrscheduler_db.py
  10. 2
      neutron/db/l3_hamode_db.py
  11. 2
      neutron/db/l3_hascheduler_db.py
  12. 2
      neutron/db/portbindings_db.py
  13. 2
      neutron/debug/debug_agent.py
  14. 141
      neutron/extensions/portbindings.py
  15. 2
      neutron/plugins/ml2/db.py
  16. 2
      neutron/plugins/ml2/driver_context.py
  17. 2
      neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py
  18. 2
      neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py
  19. 2
      neutron/plugins/ml2/drivers/mech_agent.py
  20. 2
      neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py
  21. 2
      neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py
  22. 2
      neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
  23. 2
      neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py
  24. 2
      neutron/plugins/ml2/managers.py
  25. 2
      neutron/plugins/ml2/models.py
  26. 2
      neutron/plugins/ml2/plugin.py
  27. 2
      neutron/plugins/ml2/rpc.py
  28. 2
      neutron/services/qos/drivers/linuxbridge/driver.py
  29. 2
      neutron/services/qos/drivers/openvswitch/driver.py
  30. 2
      neutron/services/qos/drivers/sriov/driver.py
  31. 2
      neutron/services/trunk/drivers/linuxbridge/driver.py
  32. 2
      neutron/services/trunk/drivers/openvswitch/driver.py
  33. 2
      neutron/services/trunk/plugin.py
  34. 2
      neutron/services/trunk/rpc/server.py
  35. 2
      neutron/services/trunk/rules.py
  36. 2
      neutron/tests/fullstack/resources/client.py
  37. 2
      neutron/tests/fullstack/resources/machine.py
  38. 2
      neutron/tests/functional/agent/l3/test_dvr_router.py
  39. 2
      neutron/tests/functional/plugins/ml2/test_plugin.py
  40. 2
      neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py
  41. 2
      neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py
  42. 3
      neutron/tests/functional/services/trunk/test_plugin.py
  43. 2
      neutron/tests/unit/_test_extension_portbindings.py
  44. 2
      neutron/tests/unit/agent/l3/test_agent.py
  45. 2
      neutron/tests/unit/agent/l3/test_dvr_local_router.py
  46. 2
      neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py
  47. 2
      neutron/tests/unit/db/test_dvr_mac_db.py
  48. 2
      neutron/tests/unit/db/test_ipam_backend_mixin.py
  49. 2
      neutron/tests/unit/db/test_l3_dvr_db.py
  50. 3
      neutron/tests/unit/db/test_l3_hamode_db.py
  51. 2
      neutron/tests/unit/debug/test_commands.py
  52. 2
      neutron/tests/unit/extensions/test_l3.py
  53. 2
      neutron/tests/unit/extensions/test_segment.py
  54. 2
      neutron/tests/unit/plugins/ml2/_test_mech_agent.py
  55. 2
      neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py
  56. 3
      neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py
  57. 2
      neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py
  58. 2
      neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py
  59. 2
      neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py
  60. 2
      neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py
  61. 2
      neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py
  62. 2
      neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py
  63. 2
      neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py
  64. 2
      neutron/tests/unit/plugins/ml2/test_db.py
  65. 2
      neutron/tests/unit/plugins/ml2/test_driver_context.py
  66. 2
      neutron/tests/unit/plugins/ml2/test_plugin.py
  67. 2
      neutron/tests/unit/plugins/ml2/test_port_binding.py
  68. 2
      neutron/tests/unit/scheduler/test_l3_agent_scheduler.py
  69. 2
      neutron/tests/unit/services/trunk/rpc/test_server.py
  70. 2
      neutron/tests/unit/services/trunk/test_plugin.py

2
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

2
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-'

2
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

2
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__)

2
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__)

2
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

2
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

2
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

2
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

2
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

2
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):

2
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):

2
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__)

141
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

2
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

2
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__)

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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):

2
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

2
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

2
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

2
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

2
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

3
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

3
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

2
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

2
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

2
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

2
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

2
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

3
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

2
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

2
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

2
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

2
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

2
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 \

2
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

2
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)

2
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

2
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

2
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