diff --git a/vmware_nsx/common/nsx_utils.py b/vmware_nsx/common/nsx_utils.py index dd29f4cc83..a78d40827f 100644 --- a/vmware_nsx/common/nsx_utils.py +++ b/vmware_nsx/common/nsx_utils.py @@ -14,7 +14,7 @@ # under the License. from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import providernet as pnet +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators from neutron_lib import constants from neutron_lib import exceptions as n_exc diff --git a/vmware_nsx/plugins/dvs/plugin.py b/vmware_nsx/plugins/dvs/plugin.py index c3bc20425d..d3694c11f8 100644 --- a/vmware_nsx/plugins/dvs/plugin.py +++ b/vmware_nsx/plugins/dvs/plugin.py @@ -34,11 +34,12 @@ from neutron.extensions import allowedaddresspairs as addr_pair from neutron.extensions import multiprovidernet as mpnet from neutron.extensions import portbindings as pbin from neutron.extensions import portsecurity as psec -from neutron.extensions import providernet as pnet +from neutron.extensions import providernet from neutron.extensions import securitygroup as ext_sg from neutron.plugins.common import constants from neutron.plugins.common import utils from neutron.quota import resource_registry +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators from neutron_lib import exceptions as n_exc @@ -282,7 +283,7 @@ class NsxDvsV2(addr_pair_db.AllowedAddressPairsMixin, def update_network(self, context, id, network): net_attrs = network['network'] - pnet._raise_if_updates_provider_attributes(net_attrs) + providernet._raise_if_updates_provider_attributes(net_attrs) with context.session.begin(subtransactions=True): net_res = super(NsxDvsV2, self).update_network(context, id, diff --git a/vmware_nsx/plugins/nsx_mh/plugin.py b/vmware_nsx/plugins/nsx_mh/plugin.py index c699e1b6e0..ead47717fc 100644 --- a/vmware_nsx/plugins/nsx_mh/plugin.py +++ b/vmware_nsx/plugins/nsx_mh/plugin.py @@ -59,11 +59,12 @@ from neutron.extensions import l3 from neutron.extensions import multiprovidernet as mpnet from neutron.extensions import portbindings as pbin from neutron.extensions import portsecurity as psec -from neutron.extensions import providernet as pnet +from neutron.extensions import providernet from neutron.extensions import securitygroup as ext_sg from neutron.plugins.common import constants as plugin_const from neutron.plugins.common import utils from neutron.quota import resource_registry +from neutron_lib.api.definitions import provider_net as pnet import vmware_nsx from vmware_nsx._i18n import _, _LE, _LI, _LW @@ -1063,7 +1064,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin, fields) for network in networks]) def update_network(self, context, id, network): - pnet._raise_if_updates_provider_attributes(network['network']) + providernet._raise_if_updates_provider_attributes(network['network']) if network["network"].get("admin_state_up") is False: raise NotImplementedError(_("admin_state_up=False networks " "are not supported.")) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index cc730b76d7..eae09e3ed8 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -69,13 +69,14 @@ from neutron.extensions import l3 from neutron.extensions import multiprovidernet as mpnet from neutron.extensions import portbindings as pbin from neutron.extensions import portsecurity as psec -from neutron.extensions import providernet as pnet +from neutron.extensions import providernet from neutron.extensions import securitygroup as ext_sg from neutron.plugins.common import constants as plugin_const from neutron.plugins.common import utils from neutron.quota import resource_registry from neutron.services.flavors import flavors_plugin from neutron.services.qos import qos_consts +from neutron_lib.api.definitions import provider_net as pnet from vmware_nsx.dvs import dvs from vmware_nsx.services.qos.common import utils as qos_com_utils from vmware_nsx.services.qos.nsx_v import utils as qos_utils @@ -1307,7 +1308,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, net_attrs = network['network'] original_network = self.get_network(context, id) - pnet._raise_if_updates_provider_attributes(net_attrs) + providernet._raise_if_updates_provider_attributes(net_attrs) if net_attrs.get("admin_state_up") is False: raise NotImplementedError(_("admin_state_up=False networks " "are not supported.")) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 06cb010663..e00f356923 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -56,12 +56,13 @@ from neutron.extensions import extra_dhcp_opt as ext_edo from neutron.extensions import l3 from neutron.extensions import portbindings as pbin from neutron.extensions import portsecurity as psec -from neutron.extensions import providernet as pnet +from neutron.extensions import providernet from neutron.extensions import securitygroup as ext_sg from neutron.plugins.common import constants as plugin_const from neutron.plugins.common import utils as n_utils from neutron.quota import resource_registry from neutron.services.qos import qos_consts +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators from neutron_lib import constants as const from neutron_lib import exceptions as n_exc @@ -918,7 +919,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, original_net = super(NsxV3Plugin, self).get_network(context, id) net_data = network['network'] # Neutron does not support changing provider network values - pnet._raise_if_updates_provider_attributes(net_data) + providernet._raise_if_updates_provider_attributes(net_data) extern_net = self._network_is_external(context, id) if extern_net: self._assert_on_external_net_with_qos(net_data) diff --git a/vmware_nsx/services/ipam/nsx_v/driver.py b/vmware_nsx/services/ipam/nsx_v/driver.py index 7defee57e3..969e90ddbd 100644 --- a/vmware_nsx/services/ipam/nsx_v/driver.py +++ b/vmware_nsx/services/ipam/nsx_v/driver.py @@ -21,9 +21,9 @@ from oslo_log import log as logging from neutron.extensions import external_net as ext_net_extn from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import providernet as pnet from neutron.ipam import exceptions as ipam_exc from neutron.ipam import requests as ipam_req +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators from vmware_nsx._i18n import _, _LE diff --git a/vmware_nsx/services/l2gateway/nsx_v3/driver.py b/vmware_nsx/services/l2gateway/nsx_v3/driver.py index ef19d94dde..04e6a179d8 100644 --- a/vmware_nsx/services/l2gateway/nsx_v3/driver.py +++ b/vmware_nsx/services/l2gateway/nsx_v3/driver.py @@ -27,8 +27,8 @@ from neutron.callbacks import events from neutron.callbacks import registry from neutron.callbacks import resources from neutron import context -from neutron.extensions import providernet from neutron.plugins.common import utils as n_utils +from neutron_lib.api.definitions import provider_net as providernet from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory diff --git a/vmware_nsx/tests/unit/extensions/test_providernet.py b/vmware_nsx/tests/unit/extensions/test_providernet.py index 1dbab9e7d4..9a65f3dc26 100644 --- a/vmware_nsx/tests/unit/extensions/test_providernet.py +++ b/vmware_nsx/tests/unit/extensions/test_providernet.py @@ -17,7 +17,7 @@ from oslo_config import cfg import webob.exc from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import providernet as pnet +from neutron_lib.api.definitions import provider_net as pnet from vmware_nsx.tests import unit as vmware from vmware_nsx.tests.unit.nsx_mh import test_plugin as test_nsx_plugin diff --git a/vmware_nsx/tests/unit/nsx_mh/test_plugin.py b/vmware_nsx/tests/unit/nsx_mh/test_plugin.py index 2aa66b2754..4b73a04c27 100644 --- a/vmware_nsx/tests/unit/nsx_mh/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_mh/test_plugin.py @@ -23,7 +23,6 @@ from neutron.extensions import external_net from neutron.extensions import l3 from neutron.extensions import l3_ext_gw_mode from neutron.extensions import portbindings -from neutron.extensions import providernet as pnet from neutron.extensions import securitygroup as secgrp from neutron.tests.unit import _test_extension_portbindings as test_bindings import neutron.tests.unit.db.test_db_base_plugin_v2 as test_plugin @@ -32,6 +31,7 @@ import neutron.tests.unit.extensions.test_l3 as test_l3_plugin import neutron.tests.unit.extensions.test_l3_ext_gw_mode as test_ext_gw_mode import neutron.tests.unit.extensions.test_securitygroup as ext_sg from neutron.tests.unit import testlib_api +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants from neutron_lib import exceptions as ntn_exc from neutron_lib.plugins import directory diff --git a/vmware_nsx/tests/unit/nsx_mh/test_utils.py b/vmware_nsx/tests/unit/nsx_mh/test_utils.py index 7ad51fc768..566cf90399 100644 --- a/vmware_nsx/tests/unit/nsx_mh/test_utils.py +++ b/vmware_nsx/tests/unit/nsx_mh/test_utils.py @@ -16,8 +16,8 @@ import mock from neutron.db import api as db_api from neutron.extensions import multiprovidernet as mpnet -from neutron.extensions import providernet as pnet from neutron.tests import base +from neutron_lib.api.definitions import provider_net as pnet from oslo_utils import uuidutils from vmware_nsx.api_client import exception as api_exc diff --git a/vmware_nsx/tests/unit/nsx_v/test_plugin.py b/vmware_nsx/tests/unit/nsx_v/test_plugin.py index 7f046b1dd7..a94b76d6f1 100644 --- a/vmware_nsx/tests/unit/nsx_v/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v/test_plugin.py @@ -28,7 +28,6 @@ from neutron.extensions import l3 from neutron.extensions import l3_ext_gw_mode from neutron.extensions import l3_flavors from neutron.extensions import portbindings -from neutron.extensions import providernet as pnet from neutron.extensions import router_availability_zone from neutron.extensions import securitygroup as secgrp from neutron.objects.qos import policy as qos_pol @@ -43,6 +42,7 @@ import neutron.tests.unit.extensions.test_l3_ext_gw_mode as test_ext_gw_mode import neutron.tests.unit.extensions.test_portsecurity as test_psec import neutron.tests.unit.extensions.test_securitygroup as ext_sg from neutron.tests.unit import testlib_api +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators from neutron_lib import constants from neutron_lib import exceptions as n_exc diff --git a/vmware_nsx/tests/unit/nsx_v3/test_dhcp_metadata.py b/vmware_nsx/tests/unit/nsx_v3/test_dhcp_metadata.py index 99a19b27ba..6ee7e1585c 100644 --- a/vmware_nsx/tests/unit/nsx_v3/test_dhcp_metadata.py +++ b/vmware_nsx/tests/unit/nsx_v3/test_dhcp_metadata.py @@ -17,9 +17,9 @@ import mock import netaddr from neutron import context -from neutron.extensions import providernet as pnet from neutron.extensions import securitygroup as secgrp +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants from neutron_lib import exceptions as n_exc from oslo_config import cfg diff --git a/vmware_nsx/tests/unit/nsx_v3/test_plugin.py b/vmware_nsx/tests/unit/nsx_v3/test_plugin.py index 6ec1523043..cea6897857 100644 --- a/vmware_nsx/tests/unit/nsx_v3/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v3/test_plugin.py @@ -25,7 +25,6 @@ from neutron.extensions import extraroute from neutron.extensions import l3 from neutron.extensions import l3_ext_gw_mode from neutron.extensions import portbindings -from neutron.extensions import providernet as pnet from neutron.extensions import securitygroup as secgrp from neutron.tests.unit import _test_extension_portbindings as test_bindings from neutron.tests.unit.db import test_db_base_plugin_v2 as test_plugin @@ -37,6 +36,7 @@ from neutron.tests.unit.extensions \ from neutron.tests.unit.scheduler \ import test_dhcp_agent_scheduler as test_dhcpagent +from neutron_lib.api.definitions import provider_net as pnet from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory diff --git a/vmware_nsx/tests/unit/services/ipam/test_nsxv_driver.py b/vmware_nsx/tests/unit/services/ipam/test_nsxv_driver.py index b8315568a2..7df4712b9d 100644 --- a/vmware_nsx/tests/unit/services/ipam/test_nsxv_driver.py +++ b/vmware_nsx/tests/unit/services/ipam/test_nsxv_driver.py @@ -16,7 +16,7 @@ from oslo_config import cfg from vmware_nsx.tests.unit.nsx_v import test_plugin -from neutron.extensions import providernet as pnet +from neutron_lib.api.definitions import provider_net as pnet class TestNsxvIpamSubnets(test_plugin.TestSubnetsV2):