summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoden R <bodenvmw@gmail.com>2017-01-18 13:12:40 -0700
committerBoden R <bodenvmw@gmail.com>2017-03-31 09:16:22 -0600
commit7bd521e7ce1c4ffe5b65aad12f3a1c1394c55473 (patch)
tree6574c7777161ea08eb28d5dc6f1f985515dd02bc
parentfb268d7e91b22192a6e42f78b0057b4ebd3033ef (diff)
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
Notes
Notes (review): Code-Review+2: Ihar Hrachyshka <ihrachys@redhat.com> Verified+1: Mellanox CI <mlnx-openstack-ci@dev.mellanox.co.il> Code-Review+2: Kevin Benton <kevin@benton.pub> Workflow+1: Kevin Benton <kevin@benton.pub> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sun, 02 Apr 2017 03:25:51 +0000 Reviewed-on: https://review.openstack.org/422210 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--doc/source/devref/contribute.rst2
-rw-r--r--neutron/agent/l3/ha_router.py2
-rw-r--r--neutron/api/rpc/handlers/dhcp_rpc.py2
-rw-r--r--neutron/api/rpc/handlers/l3_rpc.py2
-rw-r--r--neutron/db/dvr_mac_db.py2
-rw-r--r--neutron/db/ipam_backend_mixin.py2
-rw-r--r--neutron/db/ipam_pluggable_backend.py2
-rw-r--r--neutron/db/l3_dvr_db.py2
-rw-r--r--neutron/db/l3_dvrscheduler_db.py2
-rw-r--r--neutron/db/l3_hamode_db.py2
-rw-r--r--neutron/db/l3_hascheduler_db.py2
-rw-r--r--neutron/db/portbindings_db.py2
-rw-r--r--neutron/debug/debug_agent.py2
-rw-r--r--neutron/extensions/portbindings.py141
-rw-r--r--neutron/plugins/ml2/db.py2
-rw-r--r--neutron/plugins/ml2/driver_context.py2
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py2
-rw-r--r--neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py2
-rw-r--r--neutron/plugins/ml2/drivers/mech_agent.py2
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py2
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py2
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py2
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py2
-rw-r--r--neutron/plugins/ml2/managers.py2
-rw-r--r--neutron/plugins/ml2/models.py2
-rw-r--r--neutron/plugins/ml2/plugin.py2
-rw-r--r--neutron/plugins/ml2/rpc.py2
-rw-r--r--neutron/services/qos/drivers/linuxbridge/driver.py2
-rw-r--r--neutron/services/qos/drivers/openvswitch/driver.py2
-rw-r--r--neutron/services/qos/drivers/sriov/driver.py2
-rw-r--r--neutron/services/trunk/drivers/linuxbridge/driver.py2
-rw-r--r--neutron/services/trunk/drivers/openvswitch/driver.py2
-rw-r--r--neutron/services/trunk/plugin.py2
-rw-r--r--neutron/services/trunk/rpc/server.py2
-rw-r--r--neutron/services/trunk/rules.py2
-rw-r--r--neutron/tests/fullstack/resources/client.py2
-rw-r--r--neutron/tests/fullstack/resources/machine.py2
-rw-r--r--neutron/tests/functional/agent/l3/test_dvr_router.py2
-rw-r--r--neutron/tests/functional/plugins/ml2/test_plugin.py2
-rw-r--r--neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py2
-rw-r--r--neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py2
-rw-r--r--neutron/tests/functional/services/trunk/test_plugin.py3
-rw-r--r--neutron/tests/unit/_test_extension_portbindings.py2
-rw-r--r--neutron/tests/unit/agent/l3/test_agent.py2
-rw-r--r--neutron/tests/unit/agent/l3/test_dvr_local_router.py2
-rw-r--r--neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py2
-rw-r--r--neutron/tests/unit/db/test_dvr_mac_db.py2
-rw-r--r--neutron/tests/unit/db/test_ipam_backend_mixin.py2
-rw-r--r--neutron/tests/unit/db/test_l3_dvr_db.py2
-rw-r--r--neutron/tests/unit/db/test_l3_hamode_db.py3
-rw-r--r--neutron/tests/unit/debug/test_commands.py2
-rw-r--r--neutron/tests/unit/extensions/test_l3.py2
-rw-r--r--neutron/tests/unit/extensions/test_segment.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/_test_mech_agent.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py3
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/macvtap/mech_driver/test_mech_macvtap.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/test_db.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/test_driver_context.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/test_plugin.py2
-rw-r--r--neutron/tests/unit/plugins/ml2/test_port_binding.py2
-rw-r--r--neutron/tests/unit/scheduler/test_l3_agent_scheduler.py2
-rw-r--r--neutron/tests/unit/services/trunk/rpc/test_server.py2
-rw-r--r--neutron/tests/unit/services/trunk/test_plugin.py2
70 files changed, 75 insertions, 207 deletions
diff --git a/doc/source/devref/contribute.rst b/doc/source/devref/contribute.rst
index a9544d5..8f7366c 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::
569 interface_driver = networking_foo.agent.linux.interface.FooInterfaceDriver 569 interface_driver = networking_foo.agent.linux.interface.FooInterfaceDriver
570 570
571**ToDo: Interface Driver port bindings.** 571**ToDo: Interface Driver port bindings.**
572 ``VIF_TYPE_*`` constants in ``neutron/extensions/portbindings.py`` should be 572 ``VIF_TYPE_*`` constants in ``neutron_lib/api/definitions/portbindings.py`` should be
573 moved from neutron core to the repositories where their drivers are 573 moved from neutron core to the repositories where their drivers are
574 implemented. We need to provide some config or hook mechanism for VIF types 574 implemented. We need to provide some config or hook mechanism for VIF types
575 to be registered by external interface drivers. For Nova, selecting the VIF 575 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 011a03e..0ac12a9 100644
--- a/neutron/agent/l3/ha_router.py
+++ b/neutron/agent/l3/ha_router.py
@@ -17,6 +17,7 @@ import shutil
17import signal 17import signal
18 18
19import netaddr 19import netaddr
20from neutron_lib.api.definitions import portbindings
20from neutron_lib import constants as n_consts 21from neutron_lib import constants as n_consts
21from oslo_log import log as logging 22from oslo_log import log as logging
22 23
@@ -27,7 +28,6 @@ from neutron.agent.linux import external_process
27from neutron.agent.linux import ip_lib 28from neutron.agent.linux import ip_lib
28from neutron.agent.linux import keepalived 29from neutron.agent.linux import keepalived
29from neutron.common import utils as common_utils 30from neutron.common import utils as common_utils
30from neutron.extensions import portbindings
31 31
32LOG = logging.getLogger(__name__) 32LOG = logging.getLogger(__name__)
33HA_DEV_PREFIX = 'ha-' 33HA_DEV_PREFIX = 'ha-'
diff --git a/neutron/api/rpc/handlers/dhcp_rpc.py b/neutron/api/rpc/handlers/dhcp_rpc.py
index e24f1ad..16029f3 100644
--- a/neutron/api/rpc/handlers/dhcp_rpc.py
+++ b/neutron/api/rpc/handlers/dhcp_rpc.py
@@ -17,6 +17,7 @@ import copy
17import itertools 17import itertools
18import operator 18import operator
19 19
20from neutron_lib.api.definitions import portbindings
20from neutron_lib import constants 21from neutron_lib import constants
21from neutron_lib import exceptions 22from neutron_lib import exceptions
22from neutron_lib.plugins import directory 23from neutron_lib.plugins import directory
@@ -33,7 +34,6 @@ from neutron.common import exceptions as n_exc
33from neutron.common import utils 34from neutron.common import utils
34from neutron.db import api as db_api 35from neutron.db import api as db_api
35from neutron.db import provisioning_blocks 36from neutron.db import provisioning_blocks
36from neutron.extensions import portbindings
37from neutron.extensions import segment as segment_ext 37from neutron.extensions import segment as segment_ext
38from neutron.plugins.common import utils as p_utils 38from neutron.plugins.common import utils as p_utils
39from neutron.quota import resource_registry 39from neutron.quota import resource_registry
diff --git a/neutron/api/rpc/handlers/l3_rpc.py b/neutron/api/rpc/handlers/l3_rpc.py
index 079271f..e68f2ab 100644
--- a/neutron/api/rpc/handlers/l3_rpc.py
+++ b/neutron/api/rpc/handlers/l3_rpc.py
@@ -13,6 +13,7 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from neutron_lib import context as neutron_context 18from neutron_lib import context as neutron_context
18from neutron_lib import exceptions 19from neutron_lib import exceptions
@@ -26,7 +27,6 @@ from neutron.common import constants as n_const
26from neutron.common import utils 27from neutron.common import utils
27from neutron.db import api as db_api 28from neutron.db import api as db_api
28from neutron.extensions import l3 29from neutron.extensions import l3
29from neutron.extensions import portbindings
30 30
31 31
32LOG = logging.getLogger(__name__) 32LOG = logging.getLogger(__name__)
diff --git a/neutron/db/dvr_mac_db.py b/neutron/db/dvr_mac_db.py
index f03e171..0f25617 100644
--- a/neutron/db/dvr_mac_db.py
+++ b/neutron/db/dvr_mac_db.py
@@ -13,6 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from neutron_lib import exceptions as n_exc 18from neutron_lib import exceptions as n_exc
18from neutron_lib.plugins import directory 19from neutron_lib.plugins import directory
@@ -33,7 +34,6 @@ from neutron.db import api as db_api
33from neutron.db.models import dvr as dvr_models 34from neutron.db.models import dvr as dvr_models
34from neutron.db import models_v2 35from neutron.db import models_v2
35from neutron.extensions import dvr as ext_dvr 36from neutron.extensions import dvr as ext_dvr
36from neutron.extensions import portbindings
37 37
38 38
39LOG = logging.getLogger(__name__) 39LOG = logging.getLogger(__name__)
diff --git a/neutron/db/ipam_backend_mixin.py b/neutron/db/ipam_backend_mixin.py
index 06183cd..385a6a5 100644
--- a/neutron/db/ipam_backend_mixin.py
+++ b/neutron/db/ipam_backend_mixin.py
@@ -18,6 +18,7 @@ import copy
18import itertools 18import itertools
19 19
20import netaddr 20import netaddr
21from neutron_lib.api.definitions import portbindings
21from neutron_lib.api import validators 22from neutron_lib.api import validators
22from neutron_lib import constants as const 23from neutron_lib import constants as const
23from neutron_lib import exceptions as exc 24from neutron_lib import exceptions as exc
@@ -38,7 +39,6 @@ from neutron.db.models import segment as segment_model
38from neutron.db.models import subnet_service_type as sst_model 39from neutron.db.models import subnet_service_type as sst_model
39from neutron.db import models_v2 40from neutron.db import models_v2
40from neutron.extensions import ip_allocation as ipa 41from neutron.extensions import ip_allocation as ipa
41from neutron.extensions import portbindings
42from neutron.extensions import segment 42from neutron.extensions import segment
43from neutron.ipam import exceptions as ipam_exceptions 43from neutron.ipam import exceptions as ipam_exceptions
44from neutron.ipam import utils as ipam_utils 44from neutron.ipam import utils as ipam_utils
diff --git a/neutron/db/ipam_pluggable_backend.py b/neutron/db/ipam_pluggable_backend.py
index 77f5268..d89b2a6 100644
--- a/neutron/db/ipam_pluggable_backend.py
+++ b/neutron/db/ipam_pluggable_backend.py
@@ -16,6 +16,7 @@
16import copy 16import copy
17 17
18import netaddr 18import netaddr
19from neutron_lib.api.definitions import portbindings
19from neutron_lib import constants 20from neutron_lib import constants
20from neutron_lib import exceptions as n_exc 21from neutron_lib import exceptions as n_exc
21from oslo_db import exception as db_exc 22from oslo_db import exception as db_exc
@@ -28,7 +29,6 @@ from neutron.common import constants as n_const
28from neutron.common import ipv6_utils 29from neutron.common import ipv6_utils
29from neutron.db import ipam_backend_mixin 30from neutron.db import ipam_backend_mixin
30from neutron.db import models_v2 31from neutron.db import models_v2
31from neutron.extensions import portbindings
32from neutron.ipam import driver 32from neutron.ipam import driver
33from neutron.ipam import exceptions as ipam_exc 33from neutron.ipam import exceptions as ipam_exc
34 34
diff --git a/neutron/db/l3_dvr_db.py b/neutron/db/l3_dvr_db.py
index 4626857..3825387 100644
--- a/neutron/db/l3_dvr_db.py
+++ b/neutron/db/l3_dvr_db.py
@@ -13,6 +13,7 @@
13# under the License. 13# under the License.
14import collections 14import collections
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.api import validators 17from neutron_lib.api import validators
17from neutron_lib import constants as const 18from neutron_lib import constants as const
18from neutron_lib import exceptions as n_exc 19from neutron_lib import exceptions as n_exc
@@ -38,7 +39,6 @@ from neutron.db.models import l3 as l3_models
38from neutron.db.models import l3agent as rb_model 39from neutron.db.models import l3agent as rb_model
39from neutron.db import models_v2 40from neutron.db import models_v2
40from neutron.extensions import l3 41from neutron.extensions import l3
41from neutron.extensions import portbindings
42from neutron.ipam import utils as ipam_utils 42from neutron.ipam import utils as ipam_utils
43from neutron.plugins.common import utils as p_utils 43from neutron.plugins.common import utils as p_utils
44 44
diff --git a/neutron/db/l3_dvrscheduler_db.py b/neutron/db/l3_dvrscheduler_db.py
index 04adc6c..8399154 100644
--- a/neutron/db/l3_dvrscheduler_db.py
+++ b/neutron/db/l3_dvrscheduler_db.py
@@ -13,6 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants as n_const 17from neutron_lib import constants as n_const
17from neutron_lib.plugins import directory 18from neutron_lib.plugins import directory
18from oslo_log import log as logging 19from oslo_log import log as logging
@@ -27,7 +28,6 @@ from neutron.db import agentschedulers_db
27from neutron.db import l3_agentschedulers_db as l3agent_sch_db 28from neutron.db import l3_agentschedulers_db as l3agent_sch_db
28from neutron.db.models import l3agent as rb_model 29from neutron.db.models import l3agent as rb_model
29from neutron.db import models_v2 30from neutron.db import models_v2
30from neutron.extensions import portbindings
31from neutron.plugins.ml2 import db as ml2_db 31from neutron.plugins.ml2 import db as ml2_db
32from neutron.plugins.ml2 import models as ml2_models 32from neutron.plugins.ml2 import models as ml2_models
33 33
diff --git a/neutron/db/l3_hamode_db.py b/neutron/db/l3_hamode_db.py
index 04384c4..1dcb17e 100644
--- a/neutron/db/l3_hamode_db.py
+++ b/neutron/db/l3_hamode_db.py
@@ -16,6 +16,7 @@
16import functools 16import functools
17 17
18import netaddr 18import netaddr
19from neutron_lib.api.definitions import portbindings
19from neutron_lib.api.definitions import provider_net as providernet 20from neutron_lib.api.definitions import provider_net as providernet
20from neutron_lib.api import validators 21from neutron_lib.api import validators
21from neutron_lib import constants 22from neutron_lib import constants
@@ -48,7 +49,6 @@ from neutron.db.models import l3_attrs
48from neutron.db.models import l3ha as l3ha_model 49from neutron.db.models import l3ha as l3ha_model
49from neutron.extensions import l3 50from neutron.extensions import l3
50from neutron.extensions import l3_ext_ha_mode as l3_ha 51from neutron.extensions import l3_ext_ha_mode as l3_ha
51from neutron.extensions import portbindings
52from neutron.plugins.common import utils as p_utils 52from neutron.plugins.common import utils as p_utils
53 53
54 54
diff --git a/neutron/db/l3_hascheduler_db.py b/neutron/db/l3_hascheduler_db.py
index 1772722..93e5eb7 100644
--- a/neutron/db/l3_hascheduler_db.py
+++ b/neutron/db/l3_hascheduler_db.py
@@ -12,6 +12,7 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14 14
15from neutron_lib.api.definitions import portbindings
15from neutron_lib import constants 16from neutron_lib import constants
16from neutron_lib.plugins import directory 17from neutron_lib.plugins import directory
17from sqlalchemy import func 18from sqlalchemy import func
@@ -22,7 +23,6 @@ from neutron.callbacks import resources
22from neutron.db import l3_agentschedulers_db as l3_sch_db 23from neutron.db import l3_agentschedulers_db as l3_sch_db
23from neutron.db.models import agent as agent_model 24from neutron.db.models import agent as agent_model
24from neutron.db.models import l3agent as rb_model 25from neutron.db.models import l3agent as rb_model
25from neutron.extensions import portbindings
26 26
27 27
28class L3_HA_scheduler_db_mixin(l3_sch_db.AZL3AgentSchedulerDbMixin): 28class L3_HA_scheduler_db_mixin(l3_sch_db.AZL3AgentSchedulerDbMixin):
diff --git a/neutron/db/portbindings_db.py b/neutron/db/portbindings_db.py
index fe79d4b..1bb4335 100644
--- a/neutron/db/portbindings_db.py
+++ b/neutron/db/portbindings_db.py
@@ -13,6 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.api import validators 17from neutron_lib.api import validators
17 18
18from neutron.api.v2 import attributes 19from neutron.api.v2 import attributes
@@ -21,7 +22,6 @@ from neutron.db import _resource_extend as resource_extend
21from neutron.db.models import portbinding as pmodels 22from neutron.db.models import portbinding as pmodels
22from neutron.db import models_v2 23from neutron.db import models_v2
23from neutron.db import portbindings_base 24from neutron.db import portbindings_base
24from neutron.extensions import portbindings
25 25
26 26
27class PortBindingMixin(portbindings_base.PortBindingBaseMixin): 27class PortBindingMixin(portbindings_base.PortBindingBaseMixin):
diff --git a/neutron/debug/debug_agent.py b/neutron/debug/debug_agent.py
index e1a564a..07f7b18 100644
--- a/neutron/debug/debug_agent.py
+++ b/neutron/debug/debug_agent.py
@@ -17,13 +17,13 @@ import shlex
17import socket 17import socket
18 18
19import netaddr 19import netaddr
20from neutron_lib.api.definitions import portbindings
20from neutron_lib import constants 21from neutron_lib import constants
21from oslo_log import log as logging 22from oslo_log import log as logging
22 23
23from neutron._i18n import _LW 24from neutron._i18n import _LW
24from neutron.agent.linux import dhcp 25from neutron.agent.linux import dhcp
25from neutron.agent.linux import ip_lib 26from neutron.agent.linux import ip_lib
26from neutron.extensions import portbindings
27 27
28LOG = logging.getLogger(__name__) 28LOG = logging.getLogger(__name__)
29 29
diff --git a/neutron/extensions/portbindings.py b/neutron/extensions/portbindings.py
index 00cfe12..df5af4a 100644
--- a/neutron/extensions/portbindings.py
+++ b/neutron/extensions/portbindings.py
@@ -13,126 +13,11 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.api import extensions 17from neutron_lib.api import extensions
17from neutron_lib import constants
18 18
19 19
20# The type of vnic that this port should be attached to 20class Portbindings(extensions.APIExtensionDescriptor):
21VNIC_TYPE = 'binding:vnic_type'
22# The service will return the vif type for the specific port.
23VIF_TYPE = 'binding:vif_type'
24# The service may return a dictionary containing additional
25# information needed by the interface driver. The set of items
26# returned may depend on the value of VIF_TYPE.
27VIF_DETAILS = 'binding:vif_details'
28# In some cases different implementations may be run on different hosts.
29# The host on which the port will be allocated.
30HOST_ID = 'binding:host_id'
31# The profile will be a dictionary that enables the application running
32# on the specific host to pass and receive vif port specific information to
33# the plugin.
34PROFILE = 'binding:profile'
35
36# The keys below are used in the VIF_DETAILS attribute to convey
37# information to the VIF driver.
38
39# TODO(rkukura): Replace CAP_PORT_FILTER, which nova no longer
40# understands, with the new set of VIF security details to be used in
41# the VIF_DETAILS attribute.
42#
43# - port_filter : Boolean value indicating Neutron provides port filtering
44# features such as security group and anti MAC/IP spoofing
45# - ovs_hybrid_plug: Boolean used to inform Nova that the hybrid plugging
46# strategy for OVS should be used
47CAP_PORT_FILTER = 'port_filter'
48OVS_HYBRID_PLUG = 'ovs_hybrid_plug'
49VIF_DETAILS_VLAN = 'vlan'
50VIF_DETAILS_MACVTAP_SOURCE = 'macvtap_source'
51VIF_DETAILS_MACVTAP_MODE = 'macvtap_mode'
52VIF_DETAILS_PHYSICAL_INTERFACE = 'physical_interface'
53VIF_DETAILS_BRIDGE_NAME = 'bridge_name'
54
55# The keys below are used in the VIF_DETAILS attribute to convey
56# information related to the configuration of the vhost-user VIF driver.
57
58# - vhost_user_mode: String value used to declare the mode of a
59# vhost-user socket
60VHOST_USER_MODE = 'vhostuser_mode'
61# - server: socket created by hypervisor
62VHOST_USER_MODE_SERVER = 'server'
63# - client: socket created by vswitch
64VHOST_USER_MODE_CLIENT = 'client'
65# - vhostuser_socket String value used to declare the vhostuser socket name
66VHOST_USER_SOCKET = 'vhostuser_socket'
67# - vhost_user_ovs_plug: Boolean used to inform Nova that the ovs plug
68# method should be used when binding the
69# vhost-user vif.
70VHOST_USER_OVS_PLUG = 'vhostuser_ovs_plug'
71
72# VIF_TYPE: vif_types are required by Nova to determine which vif_driver to
73# use to attach a virtual server to the network
74
75# - vhost-user: The vhost-user interface type is a standard virtio interface
76# provided by qemu 2.1+. This constant defines the neutron side
77# of the vif binding type to provide a common definition
78# to enable reuse in multiple agents and drivers.
79VIF_TYPE_VHOST_USER = 'vhostuser'
80
81VIF_TYPE_UNBOUND = 'unbound'
82VIF_TYPE_BINDING_FAILED = 'binding_failed'
83VIF_TYPE_DISTRIBUTED = 'distributed'
84VIF_TYPE_OVS = 'ovs'
85VIF_TYPE_BRIDGE = 'bridge'
86VIF_TYPE_OTHER = 'other'
87# vif_type_macvtap: Tells Nova that the macvtap vif_driver should be used to
88# create a vif. It does not require the VNIC_TYPE_MACVTAP,
89# which is defined further below. E.g. Macvtap agent uses
90# vnic_type 'normal'.
91VIF_TYPE_MACVTAP = 'macvtap'
92# SR-IOV VIF types
93VIF_TYPE_HW_VEB = 'hw_veb'
94VIF_TYPE_HOSTDEV_PHY = 'hostdev_physical'
95
96# VNIC_TYPE: It's used to determine which mechanism driver to use to bind a
97# port. It can be specified via the Neutron API. Default is normal,
98# used by OVS and LinuxBridge agent.
99VNIC_NORMAL = 'normal'
100VNIC_DIRECT = 'direct'
101VNIC_MACVTAP = 'macvtap'
102VNIC_BAREMETAL = 'baremetal'
103VNIC_DIRECT_PHYSICAL = 'direct-physical'
104VNIC_TYPES = [VNIC_NORMAL, VNIC_DIRECT, VNIC_MACVTAP, VNIC_BAREMETAL,
105 VNIC_DIRECT_PHYSICAL]
106
107EXTENDED_ATTRIBUTES_2_0 = {
108 'ports': {
109 VIF_TYPE: {'allow_post': False, 'allow_put': False,
110 'default': constants.ATTR_NOT_SPECIFIED,
111 'enforce_policy': True,
112 'is_visible': True},
113 VIF_DETAILS: {'allow_post': False, 'allow_put': False,
114 'default': constants.ATTR_NOT_SPECIFIED,
115 'enforce_policy': True,
116 'is_visible': True},
117 VNIC_TYPE: {'allow_post': True, 'allow_put': True,
118 'default': VNIC_NORMAL,
119 'is_visible': True,
120 'validate': {'type:values': VNIC_TYPES},
121 'enforce_policy': True},
122 HOST_ID: {'allow_post': True, 'allow_put': True,
123 'default': constants.ATTR_NOT_SPECIFIED,
124 'is_visible': True,
125 'enforce_policy': True},
126 PROFILE: {'allow_post': True, 'allow_put': True,
127 'default': constants.ATTR_NOT_SPECIFIED,
128 'enforce_policy': True,
129 'validate': {'type:dict_or_none': None},
130 'is_visible': True},
131 }
132}
133
134
135class Portbindings(extensions.ExtensionDescriptor):
136 """Extension class supporting port bindings. 21 """Extension class supporting port bindings.
137 22
138 This class is used by neutron's extension framework to make 23 This class is used by neutron's extension framework to make
@@ -141,24 +26,4 @@ class Portbindings(extensions.ExtensionDescriptor):
141 With admin rights one will be able to update and read the values. 26 With admin rights one will be able to update and read the values.
142 """ 27 """
143 28
144 @classmethod 29 api_definition = portbindings
145 def get_name(cls):
146 return "Port Binding"
147
148 @classmethod
149 def get_alias(cls):
150 return "binding"
151
152 @classmethod
153 def get_description(cls):
154 return "Expose port bindings of a virtual port to external application"
155
156 @classmethod
157 def get_updated(cls):
158 return "2014-02-03T10:00:00-00:00"
159
160 def get_extended_resources(self, version):
161 if version == "2.0":
162 return EXTENDED_ATTRIBUTES_2_0
163 else:
164 return {}
diff --git a/neutron/plugins/ml2/db.py b/neutron/plugins/ml2/db.py
index ca9ccfd..f5d7a0f 100644
--- a/neutron/plugins/ml2/db.py
+++ b/neutron/plugins/ml2/db.py
@@ -14,6 +14,7 @@
14# under the License. 14# under the License.
15 15
16from debtcollector import removals 16from debtcollector import removals
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants as n_const 18from neutron_lib import constants as n_const
18from neutron_lib.plugins import directory 19from neutron_lib.plugins import directory
19from oslo_db import exception as db_exc 20from oslo_db import exception as db_exc
@@ -29,7 +30,6 @@ from neutron.callbacks import registry
29from neutron.callbacks import resources 30from neutron.callbacks import resources
30from neutron.db.models import securitygroup as sg_models 31from neutron.db.models import securitygroup as sg_models
31from neutron.db import models_v2 32from neutron.db import models_v2
32from neutron.extensions import portbindings
33from neutron.objects import ports as port_obj 33from neutron.objects import ports as port_obj
34from neutron.plugins.ml2 import models 34from neutron.plugins.ml2 import models
35from neutron.services.segments import exceptions as seg_exc 35from 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 565b92e..1286ccf 100644
--- a/neutron/plugins/ml2/driver_context.py
+++ b/neutron/plugins/ml2/driver_context.py
@@ -13,13 +13,13 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from oslo_log import log 18from oslo_log import log
18from oslo_serialization import jsonutils 19from oslo_serialization import jsonutils
19 20
20from neutron._i18n import _LW 21from neutron._i18n import _LW
21from neutron.db import segments_db 22from neutron.db import segments_db
22from neutron.extensions import portbindings
23from neutron.plugins.ml2 import driver_api as api 23from neutron.plugins.ml2 import driver_api as api
24 24
25LOG = log.getLogger(__name__) 25LOG = 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 4d60a18..d22eca5 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17 18
18from neutron.agent import securitygroups_rpc 19from neutron.agent import securitygroups_rpc
19from neutron.extensions import portbindings
20from neutron.plugins.common import constants as p_constants 20from neutron.plugins.common import constants as p_constants
21from neutron.plugins.ml2.drivers import mech_agent 21from neutron.plugins.ml2.drivers import mech_agent
22from neutron.services.qos.drivers.linuxbridge import driver as lb_qos_driver 22from 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 f578e8b..309cbb3 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 @@
15# under the License. 15# under the License.
16 16
17from neutron._i18n import _LE 17from neutron._i18n import _LE
18from neutron_lib.api.definitions import portbindings
18from neutron_lib import constants 19from neutron_lib import constants
19from oslo_log import log 20from oslo_log import log
20 21
21from neutron.extensions import portbindings
22from neutron.plugins.common import constants as p_constants 22from neutron.plugins.common import constants as p_constants
23from neutron.plugins.ml2 import driver_api as api 23from neutron.plugins.ml2 import driver_api as api
24from neutron.plugins.ml2.drivers.macvtap import macvtap_common 24from 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 30e6437..09efa3b 100644
--- a/neutron/plugins/ml2/drivers/mech_agent.py
+++ b/neutron/plugins/ml2/drivers/mech_agent.py
@@ -15,6 +15,7 @@
15 15
16import abc 16import abc
17 17
18from neutron_lib.api.definitions import portbindings
18from neutron_lib import constants as const 19from neutron_lib import constants as const
19from oslo_log import log 20from oslo_log import log
20import six 21import six
@@ -22,7 +23,6 @@ import six
22from neutron._i18n import _LW 23from neutron._i18n import _LW
23from neutron.callbacks import resources 24from neutron.callbacks import resources
24from neutron.db import provisioning_blocks 25from neutron.db import provisioning_blocks
25from neutron.extensions import portbindings
26from neutron.plugins.common import constants as p_constants 26from neutron.plugins.common import constants as p_constants
27from neutron.plugins.ml2 import driver_api as api 27from neutron.plugins.ml2 import driver_api as api
28 28
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 1625f74..3e3cd7a 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
20import sys 20import sys
21import time 21import time
22 22
23from neutron_lib.api.definitions import portbindings
23from neutron_lib import constants as n_constants 24from neutron_lib import constants as n_constants
24from neutron_lib import context 25from neutron_lib import context
25from neutron_lib.utils import helpers 26from neutron_lib.utils import helpers
@@ -39,7 +40,6 @@ from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
39from neutron.common import config as common_config 40from neutron.common import config as common_config
40from neutron.common import profiler as setup_profiler 41from neutron.common import profiler as setup_profiler
41from neutron.common import topics 42from neutron.common import topics
42from neutron.extensions import portbindings
43from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config 43from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config
44from neutron.plugins.ml2.drivers.mech_sriov.agent.common \ 44from neutron.plugins.ml2.drivers.mech_sriov.agent.common \
45 import exceptions as exc 45 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 61b78d0..3ee731a 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 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from oslo_log import log 18from oslo_log import log
18 19
19from neutron._i18n import _LW 20from neutron._i18n import _LW
20from neutron.extensions import portbindings
21from neutron.plugins.common import constants as p_const 21from neutron.plugins.common import constants as p_const
22from neutron.plugins.ml2 import driver_api as api 22from neutron.plugins.ml2 import driver_api as api
23from neutron.plugins.ml2.drivers import mech_agent 23from 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 0955bdc..75e886a 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
22import time 22import time
23 23
24import netaddr 24import netaddr
25from neutron_lib.api.definitions import portbindings
25from neutron_lib import constants as n_const 26from neutron_lib import constants as n_const
26from neutron_lib import context 27from neutron_lib import context
27from neutron_lib.utils import helpers 28from neutron_lib.utils import helpers
@@ -54,7 +55,6 @@ from neutron.common import config
54from neutron.common import constants as c_const 55from neutron.common import constants as c_const
55from neutron.common import topics 56from neutron.common import topics
56from neutron.conf.agent import xenapi_conf 57from neutron.conf.agent import xenapi_conf
57from neutron.extensions import portbindings
58from neutron.plugins.common import constants as p_const 58from neutron.plugins.common import constants as p_const
59from neutron.plugins.common import utils as p_utils 59from neutron.plugins.common import utils as p_utils
60from neutron.plugins.ml2.drivers.agent import capabilities 60from 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 7df8b7d..bed74fc 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 @@
15 15
16import os 16import os
17 17
18from neutron_lib.api.definitions import portbindings
18from neutron_lib import constants 19from neutron_lib import constants
19from oslo_config import cfg 20from oslo_config import cfg
20 21
21from neutron.agent import securitygroups_rpc 22from neutron.agent import securitygroups_rpc
22from neutron.callbacks import events 23from neutron.callbacks import events
23from neutron.callbacks import registry 24from neutron.callbacks import registry
24from neutron.extensions import portbindings
25from neutron.plugins.common import constants as p_constants 25from neutron.plugins.common import constants as p_constants
26from neutron.plugins.ml2 import driver_api as api 26from neutron.plugins.ml2 import driver_api as api
27from neutron.plugins.ml2.drivers import mech_agent 27from neutron.plugins.ml2.drivers import mech_agent
diff --git a/neutron/plugins/ml2/managers.py b/neutron/plugins/ml2/managers.py
index 7f0652d..b2f9db7 100644
--- a/neutron/plugins/ml2/managers.py
+++ b/neutron/plugins/ml2/managers.py
@@ -13,6 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.api.definitions import provider_net as provider 17from neutron_lib.api.definitions import provider_net as provider
17from neutron_lib.api import validators 18from neutron_lib.api import validators
18from neutron_lib import constants 19from neutron_lib import constants
@@ -28,7 +29,6 @@ from neutron.db import api as db_api
28from neutron.db import segments_db 29from neutron.db import segments_db
29from neutron.extensions import external_net 30from neutron.extensions import external_net
30from neutron.extensions import multiprovidernet as mpnet 31from neutron.extensions import multiprovidernet as mpnet
31from neutron.extensions import portbindings
32from neutron.extensions import vlantransparent 32from neutron.extensions import vlantransparent
33from neutron.plugins.ml2.common import exceptions as ml2_exc 33from neutron.plugins.ml2.common import exceptions as ml2_exc
34from neutron.plugins.ml2 import driver_api as api 34from neutron.plugins.ml2 import driver_api as api
diff --git a/neutron/plugins/ml2/models.py b/neutron/plugins/ml2/models.py
index 45e9ffc..9cf603e 100644
--- a/neutron/plugins/ml2/models.py
+++ b/neutron/plugins/ml2/models.py
@@ -13,13 +13,13 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.db import model_base 17from neutron_lib.db import model_base
17import sqlalchemy as sa 18import sqlalchemy as sa
18from sqlalchemy import orm 19from sqlalchemy import orm
19 20
20from neutron.common import constants 21from neutron.common import constants
21from neutron.db import models_v2 22from neutron.db import models_v2
22from neutron.extensions import portbindings
23 23
24BINDING_PROFILE_LEN = 4095 24BINDING_PROFILE_LEN = 4095
25 25
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index 896a0d7..40f33f1 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -14,6 +14,7 @@
14# under the License. 14# under the License.
15 15
16from eventlet import greenthread 16from eventlet import greenthread
17from neutron_lib.api.definitions import portbindings
17from neutron_lib.api.definitions import provider_net 18from neutron_lib.api.definitions import provider_net
18from neutron_lib.api import validators 19from neutron_lib.api import validators
19from neutron_lib import constants as const 20from neutron_lib import constants as const
@@ -71,7 +72,6 @@ from neutron.extensions import allowedaddresspairs as addr_pair
71from neutron.extensions import availability_zone as az_ext 72from neutron.extensions import availability_zone as az_ext
72from neutron.extensions import extra_dhcp_opt as edo_ext 73from neutron.extensions import extra_dhcp_opt as edo_ext
73from neutron.extensions import multiprovidernet as mpnet 74from neutron.extensions import multiprovidernet as mpnet
74from neutron.extensions import portbindings
75from neutron.extensions import portsecurity as psec 75from neutron.extensions import portsecurity as psec
76from neutron.extensions import providernet as provider 76from neutron.extensions import providernet as provider
77from neutron.extensions import vlantransparent 77from neutron.extensions import vlantransparent
diff --git a/neutron/plugins/ml2/rpc.py b/neutron/plugins/ml2/rpc.py
index 9ef7ab6..ddceb4f 100644
--- a/neutron/plugins/ml2/rpc.py
+++ b/neutron/plugins/ml2/rpc.py
@@ -13,6 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants as n_const 17from neutron_lib import constants as n_const
17from neutron_lib import exceptions 18from neutron_lib import exceptions
18from neutron_lib.plugins import directory 19from neutron_lib.plugins import directory
@@ -28,7 +29,6 @@ from neutron.common import rpc as n_rpc
28from neutron.common import topics 29from neutron.common import topics
29from neutron.db import l3_hamode_db 30from neutron.db import l3_hamode_db
30from neutron.db import provisioning_blocks 31from neutron.db import provisioning_blocks
31from neutron.extensions import portbindings
32from neutron.extensions import portsecurity as psec 32from neutron.extensions import portsecurity as psec
33from neutron.plugins.ml2 import db as ml2_db 33from neutron.plugins.ml2 import db as ml2_db
34from neutron.plugins.ml2 import driver_api as api 34from 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 c23feb4..6ac31e1 100644
--- a/neutron/services/qos/drivers/linuxbridge/driver.py
+++ b/neutron/services/qos/drivers/linuxbridge/driver.py
@@ -13,9 +13,9 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from oslo_log import log as logging 17from oslo_log import log as logging
17 18
18from neutron.extensions import portbindings
19from neutron.services.qos.drivers import base 19from neutron.services.qos.drivers import base
20from neutron.services.qos import qos_consts 20from neutron.services.qos import qos_consts
21 21
diff --git a/neutron/services/qos/drivers/openvswitch/driver.py b/neutron/services/qos/drivers/openvswitch/driver.py
index 469eb54..9ef67f0 100644
--- a/neutron/services/qos/drivers/openvswitch/driver.py
+++ b/neutron/services/qos/drivers/openvswitch/driver.py
@@ -13,9 +13,9 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from oslo_log import log as logging 17from oslo_log import log as logging
17 18
18from neutron.extensions import portbindings
19from neutron.services.qos.drivers import base 19from neutron.services.qos.drivers import base
20from neutron.services.qos import qos_consts 20from neutron.services.qos import qos_consts
21 21
diff --git a/neutron/services/qos/drivers/sriov/driver.py b/neutron/services/qos/drivers/sriov/driver.py
index ac5418c..b4fdeb1 100644
--- a/neutron/services/qos/drivers/sriov/driver.py
+++ b/neutron/services/qos/drivers/sriov/driver.py
@@ -13,9 +13,9 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from oslo_log import log as logging 17from oslo_log import log as logging
17 18
18from neutron.extensions import portbindings
19from neutron.services.qos.drivers import base 19from neutron.services.qos.drivers import base
20from neutron.services.qos import qos_consts 20from neutron.services.qos import qos_consts
21 21
diff --git a/neutron/services/trunk/drivers/linuxbridge/driver.py b/neutron/services/trunk/drivers/linuxbridge/driver.py
index fd982e1..3cf1494 100644
--- a/neutron/services/trunk/drivers/linuxbridge/driver.py
+++ b/neutron/services/trunk/drivers/linuxbridge/driver.py
@@ -13,9 +13,9 @@
13from oslo_config import cfg 13from oslo_config import cfg
14from oslo_log import log as logging 14from oslo_log import log as logging
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17 18
18from neutron.extensions import portbindings
19from neutron.services.trunk import constants as trunk_consts 19from neutron.services.trunk import constants as trunk_consts
20from neutron.services.trunk.drivers import base 20from neutron.services.trunk.drivers import base
21 21
diff --git a/neutron/services/trunk/drivers/openvswitch/driver.py b/neutron/services/trunk/drivers/openvswitch/driver.py
index b4b0ab8..cd8c3be 100644
--- a/neutron/services/trunk/drivers/openvswitch/driver.py
+++ b/neutron/services/trunk/drivers/openvswitch/driver.py
@@ -11,13 +11,13 @@
11# License for the specific language governing permissions and limitations 11# License for the specific language governing permissions and limitations
12# under the License. 12# under the License.
13 13
14from neutron_lib.api.definitions import portbindings
14from neutron_lib import constants 15from neutron_lib import constants
15from oslo_config import cfg 16from oslo_config import cfg
16from oslo_log import log as logging 17from oslo_log import log as logging
17 18
18from neutron.callbacks import events 19from neutron.callbacks import events
19from neutron.callbacks import registry 20from neutron.callbacks import registry
20from neutron.extensions import portbindings
21from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( 21from neutron.plugins.ml2.drivers.openvswitch.agent.common import (
22 constants as agent_consts) 22 constants as agent_consts)
23from neutron.services.trunk import constants as trunk_consts 23from neutron.services.trunk import constants as trunk_consts
diff --git a/neutron/services/trunk/plugin.py b/neutron/services/trunk/plugin.py
index 7b21f24..75e57ee 100644
--- a/neutron/services/trunk/plugin.py
+++ b/neutron/services/trunk/plugin.py
@@ -14,6 +14,7 @@
14 14
15import copy 15import copy
16 16
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import context 18from neutron_lib import context
18from neutron_lib.services import base as service_base 19from neutron_lib.services import base as service_base
19from oslo_log import log as logging 20from oslo_log import log as logging
@@ -27,7 +28,6 @@ from neutron.db import _resource_extend as resource_extend
27from neutron.db import api as db_api 28from neutron.db import api as db_api
28from neutron.db import common_db_mixin 29from neutron.db import common_db_mixin
29from neutron.db import db_base_plugin_common 30from neutron.db import db_base_plugin_common
30from neutron.extensions import portbindings
31from neutron.objects import base as objects_base 31from neutron.objects import base as objects_base
32from neutron.objects import trunk as trunk_objects 32from neutron.objects import trunk as trunk_objects
33from neutron.services.trunk import callbacks 33from neutron.services.trunk import callbacks
diff --git a/neutron/services/trunk/rpc/server.py b/neutron/services/trunk/rpc/server.py
index 7441721..efa8545 100644
--- a/neutron/services/trunk/rpc/server.py
+++ b/neutron/services/trunk/rpc/server.py
@@ -14,6 +14,7 @@
14 14
15import collections 15import collections
16 16
17from neutron_lib.api.definitions import portbindings
17from neutron_lib.plugins import directory 18from neutron_lib.plugins import directory
18from oslo_log import helpers as log_helpers 19from oslo_log import helpers as log_helpers
19from oslo_log import log as logging 20from oslo_log import log as logging
@@ -26,7 +27,6 @@ from neutron.api.rpc.callbacks import resources
26from neutron.api.rpc.handlers import resources_rpc 27from neutron.api.rpc.handlers import resources_rpc
27from neutron.common import rpc as n_rpc 28from neutron.common import rpc as n_rpc
28from neutron.db import api as db_api 29from neutron.db import api as db_api
29from neutron.extensions import portbindings
30from neutron.objects import trunk as trunk_objects 30from neutron.objects import trunk as trunk_objects
31from neutron.services.trunk import constants as trunk_consts 31from neutron.services.trunk import constants as trunk_consts
32from neutron.services.trunk import exceptions as trunk_exc 32from neutron.services.trunk import exceptions as trunk_exc
diff --git a/neutron/services/trunk/rules.py b/neutron/services/trunk/rules.py
index 689c453..d6a9c91 100644
--- a/neutron/services/trunk/rules.py
+++ b/neutron/services/trunk/rules.py
@@ -13,13 +13,13 @@
13# under the License. 13# under the License.
14 14
15from neutron_lib.api import converters 15from neutron_lib.api import converters
16from neutron_lib.api.definitions import portbindings
16from neutron_lib.api import validators 17from neutron_lib.api import validators
17from neutron_lib import exceptions as n_exc 18from neutron_lib import exceptions as n_exc
18from neutron_lib.plugins import directory 19from neutron_lib.plugins import directory
19 20
20from neutron._i18n import _ 21from neutron._i18n import _
21from neutron.common import utils as n_utils 22from neutron.common import utils as n_utils
22from neutron.extensions import portbindings
23from neutron.objects import trunk as trunk_objects 23from neutron.objects import trunk as trunk_objects
24from neutron.plugins.ml2 import driver_api as api 24from neutron.plugins.ml2 import driver_api as api
25from neutron.services.trunk import exceptions as trunk_exc 25from 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 dc07b8f..a77cf3a 100644
--- a/neutron/tests/fullstack/resources/client.py
+++ b/neutron/tests/fullstack/resources/client.py
@@ -16,11 +16,11 @@ import functools
16import netaddr 16import netaddr
17 17
18import fixtures 18import fixtures
19from neutron_lib.api.definitions import portbindings
19from neutron_lib import constants 20from neutron_lib import constants
20from neutronclient.common import exceptions 21from neutronclient.common import exceptions
21 22
22from neutron.common import utils 23from neutron.common import utils
23from neutron.extensions import portbindings
24 24
25 25
26def _safe_method(f): 26def _safe_method(f):
diff --git a/neutron/tests/fullstack/resources/machine.py b/neutron/tests/fullstack/resources/machine.py
index 58afd24..ff5cb08 100644
--- a/neutron/tests/fullstack/resources/machine.py
+++ b/neutron/tests/fullstack/resources/machine.py
@@ -16,12 +16,12 @@ import itertools
16 16
17import netaddr 17import netaddr
18 18
19from neutron_lib.api.definitions import portbindings as pbs
19from neutron_lib import constants 20from neutron_lib import constants
20 21
21from neutron.agent.linux import async_process 22from neutron.agent.linux import async_process
22from neutron.agent.linux import ip_lib 23from neutron.agent.linux import ip_lib
23from neutron.common import utils 24from neutron.common import utils
24from neutron.extensions import portbindings as pbs
25from neutron.tests.common import machine_fixtures 25from neutron.tests.common import machine_fixtures
26from neutron.tests.common import net_helpers 26from neutron.tests.common import net_helpers
27 27
diff --git a/neutron/tests/functional/agent/l3/test_dvr_router.py b/neutron/tests/functional/agent/l3/test_dvr_router.py
index 86d0e05..cb3216b 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
18 18
19import mock 19import mock
20import netaddr 20import netaddr
21from neutron_lib.api.definitions import portbindings
21from neutron_lib import constants as lib_constants 22from neutron_lib import constants as lib_constants
22import testtools 23import testtools
23 24
@@ -30,7 +31,6 @@ from neutron.agent.linux import iptables_manager
30from neutron.common import constants as n_const 31from neutron.common import constants as n_const
31from neutron.common import exceptions as n_exc 32from neutron.common import exceptions as n_exc
32from neutron.common import utils 33from neutron.common import utils
33from neutron.extensions import portbindings
34from neutron.tests.common import l3_test_common 34from neutron.tests.common import l3_test_common
35from neutron.tests.common import machine_fixtures 35from neutron.tests.common import machine_fixtures
36from neutron.tests.common import net_helpers 36from 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 e14584e..548258f 100644
--- a/neutron/tests/functional/plugins/ml2/test_plugin.py
+++ b/neutron/tests/functional/plugins/ml2/test_plugin.py
@@ -13,11 +13,11 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from neutron_lib import context 18from neutron_lib import context
18 19
19from neutron.db import agents_db 20from neutron.db import agents_db
20from neutron.extensions import portbindings
21from neutron.tests.common import helpers 21from neutron.tests.common import helpers
22from neutron.tests.unit.plugins.ml2 import base as ml2_test_base 22from neutron.tests.unit.plugins.ml2 import base as ml2_test_base
23 23
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 1bb638b..f5bb9f4 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 @@
13# under the License. 13# under the License.
14 14
15import mock 15import mock
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17 18
18from neutron.common import topics 19from neutron.common import topics
19from neutron.extensions import external_net 20from neutron.extensions import external_net
20from neutron.extensions import l3 21from neutron.extensions import l3
21from neutron.extensions import portbindings
22from neutron.tests.common import helpers 22from neutron.tests.common import helpers
23from neutron.tests.functional.services.l3_router import \ 23from neutron.tests.functional.services.l3_router import \
24 test_l3_dvr_router_plugin 24 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 a5f761f..dba4c20 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 @@
13# under the License. 13# under the License.
14 14
15import mock 15import mock
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from neutron_lib import context 18from neutron_lib import context
18 19
@@ -23,7 +24,6 @@ from neutron.callbacks import resources
23from neutron.common import topics 24from neutron.common import topics
24from neutron.extensions import external_net 25from neutron.extensions import external_net
25from neutron.extensions import l3 26from neutron.extensions import l3
26from neutron.extensions import portbindings
27from neutron.tests.common import helpers 27from neutron.tests.common import helpers
28from neutron.tests.unit.plugins.ml2 import base as ml2_test_base 28from neutron.tests.unit.plugins.ml2 import base as ml2_test_base
29 29
diff --git a/neutron/tests/functional/services/trunk/test_plugin.py b/neutron/tests/functional/services/trunk/test_plugin.py
index beb2f38..c124ef6 100644
--- a/neutron/tests/functional/services/trunk/test_plugin.py
+++ b/neutron/tests/functional/services/trunk/test_plugin.py
@@ -12,7 +12,8 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14 14
15from neutron.extensions import portbindings as pb 15from neutron_lib.api.definitions import portbindings as pb
16
16from neutron.services.trunk.drivers.openvswitch import utils 17from neutron.services.trunk.drivers.openvswitch import utils
17from neutron.services.trunk import plugin as trunk_plugin 18from neutron.services.trunk import plugin as trunk_plugin
18from neutron.tests.common import helpers 19from neutron.tests.common import helpers
diff --git a/neutron/tests/unit/_test_extension_portbindings.py b/neutron/tests/unit/_test_extension_portbindings.py
index 22314ae..b3f219f 100644
--- a/neutron/tests/unit/_test_extension_portbindings.py
+++ b/neutron/tests/unit/_test_extension_portbindings.py
@@ -13,13 +13,13 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import context 17from neutron_lib import context
17from neutron_lib.plugins import directory 18from neutron_lib.plugins import directory
18from oslo_config import cfg 19from oslo_config import cfg
19from six.moves import http_client as httplib 20from six.moves import http_client as httplib
20from webob import exc 21from webob import exc
21 22
22from neutron.extensions import portbindings
23from neutron.tests.unit.db import test_db_base_plugin_v2 23from neutron.tests.unit.db import test_db_base_plugin_v2
24 24
25 25
diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py
index d70a305..8d478aa 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
20import eventlet 20import eventlet
21import mock 21import mock
22import netaddr 22import netaddr
23from neutron_lib.api.definitions import portbindings
23from neutron_lib import constants as lib_constants 24from neutron_lib import constants as lib_constants
24from neutron_lib import exceptions as exc 25from neutron_lib import exceptions as exc
25from oslo_config import cfg 26from oslo_config import cfg
@@ -52,7 +53,6 @@ from neutron.conf.agent import common as agent_config
52from neutron.conf.agent.l3 import config as l3_config 53from neutron.conf.agent.l3 import config as l3_config
53from neutron.conf.agent.l3 import ha as ha_conf 54from neutron.conf.agent.l3 import ha as ha_conf
54from neutron.conf import common as base_config 55from neutron.conf import common as base_config
55from neutron.extensions import portbindings
56from neutron.tests import base 56from neutron.tests import base
57from neutron.tests.common import l3_test_common 57from neutron.tests.common import l3_test_common
58 58
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 6e6291a..35ab224 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 @@
14 14
15import mock 15import mock
16import netaddr 16import netaddr
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants as lib_constants 18from neutron_lib import constants as lib_constants
18from oslo_config import cfg 19from oslo_config import cfg
19from oslo_log import log 20from oslo_log import log
@@ -32,7 +33,6 @@ from neutron.conf.agent import common as agent_config
32from neutron.conf.agent.l3 import config as l3_config 33from neutron.conf.agent.l3 import config as l3_config
33from neutron.conf.agent.l3 import ha as ha_conf 34from neutron.conf.agent.l3 import ha as ha_conf
34from neutron.conf import common as base_config 35from neutron.conf import common as base_config
35from neutron.extensions import portbindings
36from neutron.tests import base 36from neutron.tests import base
37from neutron.tests.common import l3_test_common 37from neutron.tests.common import l3_test_common
38 38
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 fc99557..bf5ede3 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 @@
14# limitations under the License. 14# limitations under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants 18from neutron_lib import constants
18from neutron_lib import exceptions as n_exc 19from neutron_lib import exceptions as n_exc
19from neutron_lib.plugins import directory 20from neutron_lib.plugins import directory
@@ -25,7 +26,6 @@ from neutron.common import constants as n_const
25from neutron.common import exceptions 26from neutron.common import exceptions
26from neutron.common import utils 27from neutron.common import utils
27from neutron.db import provisioning_blocks 28from neutron.db import provisioning_blocks
28from neutron.extensions import portbindings
29from neutron.tests import base 29from neutron.tests import base
30 30
31 31
diff --git a/neutron/tests/unit/db/test_dvr_mac_db.py b/neutron/tests/unit/db/test_dvr_mac_db.py
index 1dcb324..341486e 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 @@
14# limitations under the License. 14# limitations under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants 18from neutron_lib import constants
18from neutron_lib import context 19from neutron_lib import context
19from neutron_lib.plugins import directory 20from neutron_lib.plugins import directory
@@ -25,7 +26,6 @@ from neutron.db import api as db_api
25from neutron.db import dvr_mac_db 26from neutron.db import dvr_mac_db
26from neutron.db.models import dvr as dvr_models 27from neutron.db.models import dvr as dvr_models
27from neutron.extensions import dvr 28from neutron.extensions import dvr
28from neutron.extensions import portbindings
29from neutron.tests.unit.plugins.ml2 import test_plugin 29from neutron.tests.unit.plugins.ml2 import test_plugin
30 30
31 31
diff --git a/neutron/tests/unit/db/test_ipam_backend_mixin.py b/neutron/tests/unit/db/test_ipam_backend_mixin.py
index 81f4620..ac3b5af 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 @@
15 15
16import mock 16import mock
17import netaddr 17import netaddr
18from neutron_lib.api.definitions import portbindings
18from neutron_lib import constants 19from neutron_lib import constants
19import webob.exc 20import webob.exc
20 21
21from neutron.db import db_base_plugin_v2 22from neutron.db import db_base_plugin_v2
22from neutron.db import ipam_backend_mixin 23from neutron.db import ipam_backend_mixin
23from neutron.db import portbindings_db 24from neutron.db import portbindings_db
24from neutron.extensions import portbindings
25from neutron.tests import base 25from neutron.tests import base
26from neutron.tests.unit.db import test_db_base_plugin_v2 26from neutron.tests.unit.db import test_db_base_plugin_v2
27 27
diff --git a/neutron/tests/unit/db/test_l3_dvr_db.py b/neutron/tests/unit/db/test_l3_dvr_db.py
index 7ba7fba..88c5966 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 @@
14# limitations under the License. 14# limitations under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants as const 18from neutron_lib import constants as const
18from neutron_lib import context 19from neutron_lib import context
19from neutron_lib import exceptions 20from neutron_lib import exceptions
@@ -29,7 +30,6 @@ from neutron.db import common_db_mixin
29from neutron.db import l3_agentschedulers_db 30from neutron.db import l3_agentschedulers_db
30from neutron.db import l3_dvr_db 31from neutron.db import l3_dvr_db
31from neutron.extensions import l3 32from neutron.extensions import l3
32from neutron.extensions import portbindings
33from neutron.tests.unit.db import test_db_base_plugin_v2 33from neutron.tests.unit.db import test_db_base_plugin_v2
34 34
35_uuid = uuidutils.generate_uuid 35_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 3eaddd3..ff01137 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 @@
13# under the License. 13# under the License.
14 14
15import mock 15import mock
16
17from neutron_lib.api.definitions import portbindings
16from neutron_lib.api.definitions import provider_net as providernet 18from neutron_lib.api.definitions import provider_net as providernet
17from neutron_lib import constants 19from neutron_lib import constants
18from neutron_lib import context 20from neutron_lib import context
@@ -40,7 +42,6 @@ from neutron.db.models import l3ha as l3ha_model
40from neutron.extensions import external_net 42from neutron.extensions import external_net
41from neutron.extensions import l3 43from neutron.extensions import l3
42from neutron.extensions import l3_ext_ha_mode 44from neutron.extensions import l3_ext_ha_mode
43from neutron.extensions import portbindings
44from neutron.scheduler import l3_agent_scheduler 45from neutron.scheduler import l3_agent_scheduler
45from neutron.services.revisions import revision_plugin 46from neutron.services.revisions import revision_plugin
46from neutron.tests.common import helpers 47from neutron.tests.common import helpers
diff --git a/neutron/tests/unit/debug/test_commands.py b/neutron/tests/unit/debug/test_commands.py
index 2876f50..fa0260a 100644
--- a/neutron/tests/unit/debug/test_commands.py
+++ b/neutron/tests/unit/debug/test_commands.py
@@ -16,6 +16,7 @@
16import socket 16import socket
17 17
18import mock 18import mock
19from neutron_lib.api.definitions import portbindings
19from oslo_config import cfg 20from oslo_config import cfg
20 21
21from neutron.agent.linux import interface 22from neutron.agent.linux import interface
@@ -23,7 +24,6 @@ from neutron.common import config as common_config
23from neutron.conf.agent import common as config 24from neutron.conf.agent import common as config
24from neutron.debug import commands 25from neutron.debug import commands
25from neutron.debug import debug_agent 26from neutron.debug import debug_agent
26from neutron.extensions import portbindings
27from neutron.tests import base 27from neutron.tests import base
28 28
29 29
diff --git a/neutron/tests/unit/extensions/test_l3.py b/neutron/tests/unit/extensions/test_l3.py
index c0f4973..eccd6ee 100644
--- a/neutron/tests/unit/extensions/test_l3.py
+++ b/neutron/tests/unit/extensions/test_l3.py
@@ -19,6 +19,7 @@ import copy
19 19
20import mock 20import mock
21import netaddr 21import netaddr
22from neutron_lib.api.definitions import portbindings
22from neutron_lib import constants as lib_constants 23from neutron_lib import constants as lib_constants
23from neutron_lib import context 24from neutron_lib import context
24from neutron_lib import exceptions as n_exc 25from neutron_lib import exceptions as n_exc
@@ -53,7 +54,6 @@ from neutron.db import models_v2
53from neutron.extensions import dns 54from neutron.extensions import dns
54from neutron.extensions import external_net 55from neutron.extensions import external_net
55from neutron.extensions import l3 56from neutron.extensions import l3
56from neutron.extensions import portbindings
57from neutron.plugins.ml2 import config 57from neutron.plugins.ml2 import config
58from neutron.services.revisions import revision_plugin 58from neutron.services.revisions import revision_plugin
59from neutron.tests import base 59from neutron.tests import base
diff --git a/neutron/tests/unit/extensions/test_segment.py b/neutron/tests/unit/extensions/test_segment.py
index ee28792..459817a 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
17 17
18import mock 18import mock
19import netaddr 19import netaddr
20from neutron_lib.api.definitions import portbindings
20from neutron_lib import constants 21from neutron_lib import constants
21from neutron_lib import context 22from neutron_lib import context
22from neutron_lib import exceptions as n_exc 23from neutron_lib import exceptions as n_exc
@@ -40,7 +41,6 @@ from neutron.db import portbindings_db
40from neutron.db import segments_db 41from neutron.db import segments_db
41from neutron.extensions import ip_allocation 42from neutron.extensions import ip_allocation
42from neutron.extensions import l2_adjacency 43from neutron.extensions import l2_adjacency
43from neutron.extensions import portbindings
44from neutron.extensions import segment as ext_segment 44from neutron.extensions import segment as ext_segment
45from neutron.objects import network 45from neutron.objects import network
46from neutron.plugins.common import constants as p_constants 46from 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 addfb67..5285089 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16 17
17from neutron.extensions import portbindings
18from neutron.plugins.ml2 import driver_api as api 18from neutron.plugins.ml2 import driver_api as api
19from neutron.tests import base 19from neutron.tests import base
20 20
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 cceacff..f396300 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 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14 14
15from neutron_lib.api.definitions import portbindings
15from neutron_lib import constants 16from neutron_lib import constants
16from neutron_lib import context 17from neutron_lib import context
17from neutron_lib.utils import net 18from neutron_lib.utils import net
@@ -22,7 +23,6 @@ from neutron.db.models import l3 as l3_models
22from neutron.db.models import l3_attrs 23from neutron.db.models import l3_attrs
23from neutron.db.models import l3ha as l3ha_model 24from neutron.db.models import l3ha as l3ha_model
24from neutron.db import models_v2 25from neutron.db import models_v2
25from neutron.extensions import portbindings
26from neutron.objects import network as network_obj 26from neutron.objects import network as network_obj
27from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db 27from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db
28from neutron.plugins.ml2 import models 28from 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 52128da..f7bb64b 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 @@
14# under the License. 14# under the License.
15 15
16import mock 16import mock
17
18from neutron_lib.api.definitions import portbindings
17from neutron_lib.api.definitions import provider_net as pnet 19from neutron_lib.api.definitions import provider_net as pnet
18from neutron_lib import constants 20from neutron_lib import constants
19from neutron_lib import context 21from neutron_lib import context
@@ -29,7 +31,6 @@ from neutron.db import agents_db
29from neutron.db import common_db_mixin 31from neutron.db import common_db_mixin
30from neutron.db import l3_agentschedulers_db 32from neutron.db import l3_agentschedulers_db
31from neutron.db import l3_hamode_db 33from neutron.db import l3_hamode_db
32from neutron.extensions import portbindings
33from neutron.plugins.ml2 import db as ml2_db 34from neutron.plugins.ml2 import db as ml2_db
34from neutron.plugins.ml2 import driver_context 35from neutron.plugins.ml2 import driver_context
35from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db 36from 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 22b854b..27746f6 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17 18
18from neutron.extensions import portbindings
19from neutron.plugins.ml2.drivers.linuxbridge.mech_driver \ 19from neutron.plugins.ml2.drivers.linuxbridge.mech_driver \
20 import mech_linuxbridge 20 import mech_linuxbridge
21from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base 21from 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 0c5c30c..535e7a2 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17 18
18from neutron.extensions import portbindings
19from neutron.plugins.ml2 import driver_api as api 19from neutron.plugins.ml2 import driver_api as api
20from neutron.plugins.ml2.drivers.macvtap.mech_driver import mech_macvtap 20from neutron.plugins.ml2.drivers.macvtap.mech_driver import mech_macvtap
21from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base 21from 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 bd3a02a..aa07445 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 @@
20# License for the specific language governing permissions and limitations 20# License for the specific language governing permissions and limitations
21# under the License. 21# under the License.
22 22
23from neutron_lib.api.definitions import portbindings
23from neutron_lib import constants 24from neutron_lib import constants
24 25
25from neutron.agent import securitygroups_rpc 26from neutron.agent import securitygroups_rpc
26from neutron.extensions import portbindings
27from neutron.plugins.common import constants as p_constants 27from neutron.plugins.common import constants as p_constants
28from neutron.plugins.ml2.drivers import mech_agent 28from neutron.plugins.ml2.drivers import mech_agent
29 29
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 f7e8b50..e6e83f5 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 @@
15 15
16 16
17import mock 17import mock
18from neutron_lib.api.definitions import portbindings
18from oslo_config import cfg 19from oslo_config import cfg
19from oslo_utils import uuidutils 20from oslo_utils import uuidutils
20 21
21from neutron.agent.l2 import l2_agent_extensions_manager as l2_ext_manager 22from neutron.agent.l2 import l2_agent_extensions_manager as l2_ext_manager
22from neutron.agent import rpc as agent_rpc 23from neutron.agent import rpc as agent_rpc
23from neutron.extensions import portbindings
24from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config # noqa 24from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config # noqa
25from neutron.plugins.ml2.drivers.mech_sriov.agent.common import exceptions 25from neutron.plugins.ml2.drivers.mech_sriov.agent.common import exceptions
26from neutron.plugins.ml2.drivers.mech_sriov.agent import sriov_nic_agent 26from 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 3d9b20a..227e7aa 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 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17import testtools 18import testtools
18 19
19from neutron.extensions import portbindings
20from neutron.plugins.common import constants as p_const 20from neutron.plugins.common import constants as p_const
21from neutron.plugins.ml2 import driver_api as api 21from neutron.plugins.ml2 import driver_api as api
22from neutron.plugins.ml2.drivers.mech_sriov.mech_driver \ 22from 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 e7c33ca..678a691 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants as const 17from neutron_lib import constants as const
17 18
18from neutron.extensions import portbindings
19from neutron.plugins.ml2 import driver_api as api 19from neutron.plugins.ml2 import driver_api as api
20 20
21 21
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 f9555f6..c8b8595 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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron_lib.api.definitions import portbindings
16from neutron_lib import constants 17from neutron_lib import constants
17from oslo_config import cfg 18from oslo_config import cfg
18 19
19from neutron.callbacks import events 20from neutron.callbacks import events
20from neutron.callbacks import registry 21from neutron.callbacks import registry
21from neutron.extensions import portbindings
22from neutron.plugins.ml2 import driver_api as api 22from neutron.plugins.ml2 import driver_api as api
23from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( 23from neutron.plugins.ml2.drivers.openvswitch.agent.common import (
24 constants as a_const) 24 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 3423cb9..3f04921 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
17 17
18import mock 18import mock
19import netaddr 19import netaddr
20from neutron_lib.api.definitions import portbindings
20from neutron_lib import constants 21from neutron_lib import constants
21from neutron_lib import context 22from neutron_lib import context
22from oslo_utils import uuidutils 23from oslo_utils import uuidutils
@@ -27,7 +28,6 @@ from neutron.db import db_base_plugin_v2
27from neutron.db.models import l3 as l3_models 28from neutron.db.models import l3 as l3_models
28from neutron.db import models_v2 29from neutron.db import models_v2
29from neutron.db import segments_db 30from neutron.db import segments_db
30from neutron.extensions import portbindings
31from neutron.objects import network as network_obj 31from neutron.objects import network as network_obj
32from neutron.objects import ports as port_obj 32from neutron.objects import ports as port_obj
33from neutron.plugins.ml2 import db as ml2_db 33from 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 1ab5a2a..202763c 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 @@
14# under the License. 14# under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants 18from neutron_lib import constants
18 19
19from neutron.extensions import portbindings
20from neutron.plugins.ml2 import driver_context 20from neutron.plugins.ml2 import driver_context
21from neutron.tests import base 21from neutron.tests import base
22 22
diff --git a/neutron/tests/unit/plugins/ml2/test_plugin.py b/neutron/tests/unit/plugins/ml2/test_plugin.py
index 0abc4bb..495ecb1 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
21import testtools 21import testtools
22import webob 22import webob
23 23
24from neutron_lib.api.definitions import portbindings
24from neutron_lib.api.definitions import provider_net as pnet 25from neutron_lib.api.definitions import provider_net as pnet
25from neutron_lib import constants 26from neutron_lib import constants
26from neutron_lib import context 27from neutron_lib import context
@@ -44,7 +45,6 @@ from neutron.db import segments_db
44from neutron.extensions import availability_zone as az_ext 45from neutron.extensions import availability_zone as az_ext
45from neutron.extensions import external_net 46from neutron.extensions import external_net
46from neutron.extensions import multiprovidernet as mpnet 47from neutron.extensions import multiprovidernet as mpnet
47from neutron.extensions import portbindings
48from neutron.plugins.common import constants as p_const 48from neutron.plugins.common import constants as p_const
49from neutron.plugins.ml2.common import exceptions as ml2_exc 49from neutron.plugins.ml2.common import exceptions as ml2_exc
50from neutron.plugins.ml2 import config 50from 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 ede0c63..f773104 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 @@
14# under the License. 14# under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib import constants as const 18from neutron_lib import constants as const
18from neutron_lib import context 19from neutron_lib import context
19from neutron_lib.plugins import directory 20from neutron_lib.plugins import directory
20 21
21from neutron.conf.plugins.ml2.drivers import driver_type 22from neutron.conf.plugins.ml2.drivers import driver_type
22from neutron.extensions import portbindings
23from neutron.plugins.ml2 import config 23from neutron.plugins.ml2 import config
24from neutron.plugins.ml2 import driver_context 24from neutron.plugins.ml2 import driver_context
25from neutron.plugins.ml2 import models as ml2_models 25from 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 e2ce55b..0531389 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
18import datetime 18import datetime
19 19
20import mock 20import mock
21from neutron_lib.api.definitions import portbindings
21from neutron_lib import constants 22from neutron_lib import constants
22from neutron_lib import context as n_context 23from neutron_lib import context as n_context
23from neutron_lib.plugins import directory 24from neutron_lib.plugins import directory
@@ -40,7 +41,6 @@ from neutron.db.models import l3agent as rb_model
40from neutron.db.models import l3ha as l3ha_model 41from neutron.db.models import l3ha as l3ha_model
41from neutron.extensions import l3 42from neutron.extensions import l3
42from neutron.extensions import l3agentscheduler as l3agent 43from neutron.extensions import l3agentscheduler as l3agent
43from neutron.extensions import portbindings
44from neutron import manager 44from neutron import manager
45from neutron.scheduler import l3_agent_scheduler 45from neutron.scheduler import l3_agent_scheduler
46from neutron.tests import base 46from 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 141ed4c..e94a04e 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 @@
12# under the License. 12# under the License.
13 13
14import mock 14import mock
15from neutron_lib.api.definitions import portbindings
15from neutron_lib.plugins import directory 16from neutron_lib.plugins import directory
16from oslo_config import cfg 17from oslo_config import cfg
17import oslo_messaging 18import oslo_messaging
@@ -19,7 +20,6 @@ import oslo_messaging
19from neutron.api.rpc.callbacks import events 20from neutron.api.rpc.callbacks import events
20from neutron.api.rpc.callbacks import resources 21from neutron.api.rpc.callbacks import resources
21from neutron.api.rpc.handlers import resources_rpc 22from neutron.api.rpc.handlers import resources_rpc
22from neutron.extensions import portbindings
23from neutron.objects import trunk as trunk_obj 23from neutron.objects import trunk as trunk_obj
24from neutron.plugins.ml2 import plugin as ml2_plugin 24from neutron.plugins.ml2 import plugin as ml2_plugin
25from neutron.services.trunk import constants 25from 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 d4b5504..bc17ae6 100644
--- a/neutron/tests/unit/services/trunk/test_plugin.py
+++ b/neutron/tests/unit/services/trunk/test_plugin.py
@@ -14,13 +14,13 @@
14# limitations under the License. 14# limitations under the License.
15 15
16import mock 16import mock
17from neutron_lib.api.definitions import portbindings
17from neutron_lib.plugins import directory 18from neutron_lib.plugins import directory
18import testtools 19import testtools
19 20
20from neutron.callbacks import events 21from neutron.callbacks import events
21from neutron.callbacks import registry 22from neutron.callbacks import registry
22from neutron.callbacks import resources 23from neutron.callbacks import resources
23from neutron.extensions import portbindings
24from neutron.objects import trunk as trunk_objects 24from neutron.objects import trunk as trunk_objects
25from neutron.services.trunk import callbacks 25from neutron.services.trunk import callbacks
26from neutron.services.trunk import constants 26from neutron.services.trunk import constants