From 228181c7da29885c70c67f791a94b871792cad49 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Tue, 25 Apr 2017 10:36:26 +0300 Subject: [PATCH] Use neutron-lib callbacks module Change-Id: Id348f28655d2e414201bbd71b9b2e47760aaed5a --- vmware_nsx/db/extended_security_group.py | 6 +++--- .../plugins/nsx_v/drivers/abstract_router_driver.py | 5 +++-- vmware_nsx/plugins/nsx_v/plugin.py | 6 +++--- vmware_nsx/plugins/nsx_v3/plugin.py | 8 ++++---- vmware_nsx/services/dynamic_routing/bgp_plugin.py | 6 +++--- vmware_nsx/services/flowclassifier/nsx_v/driver.py | 6 +++--- vmware_nsx/services/l2gateway/nsx_v3/driver.py | 6 +++--- vmware_nsx/services/lbaas/nsx_v/v2/loadbalancer_mgr.py | 6 +++--- vmware_nsx/services/trunk/nsx_v3/driver.py | 4 ++-- vmware_nsx/shell/admin/plugins/common/utils.py | 2 +- .../shell/admin/plugins/nsxv/resources/backup_edges.py | 2 +- .../shell/admin/plugins/nsxv/resources/config.py | 2 +- .../shell/admin/plugins/nsxv/resources/dhcp_binding.py | 2 +- vmware_nsx/shell/admin/plugins/nsxv/resources/edges.py | 2 +- .../shell/admin/plugins/nsxv/resources/metadata.py | 2 +- .../shell/admin/plugins/nsxv/resources/networks.py | 6 +++--- .../shell/admin/plugins/nsxv/resources/routers.py | 2 +- .../admin/plugins/nsxv/resources/securitygroups.py | 2 +- .../admin/plugins/nsxv/resources/spoofguard_policy.py | 2 +- .../admin/plugins/nsxv3/resources/certificates.py | 2 +- .../shell/admin/plugins/nsxv3/resources/config.py | 2 +- .../admin/plugins/nsxv3/resources/dhcp_binding.py | 2 +- .../admin/plugins/nsxv3/resources/dhcp_servers.py | 2 +- .../admin/plugins/nsxv3/resources/metadata_proxy.py | 2 +- .../shell/admin/plugins/nsxv3/resources/networks.py | 2 +- .../shell/admin/plugins/nsxv3/resources/ports.py | 2 +- .../shell/admin/plugins/nsxv3/resources/routers.py | 2 +- .../admin/plugins/nsxv3/resources/securitygroups.py | 2 +- vmware_nsx/shell/nsxadmin.py | 2 +- .../tests/unit/services/l2gateway/test_nsxv3_driver.py | 10 +++++----- vmware_nsx/tests/unit/shell/test_admin_utils.py | 2 +- 31 files changed, 55 insertions(+), 54 deletions(-) diff --git a/vmware_nsx/db/extended_security_group.py b/vmware_nsx/db/extended_security_group.py index 92794e2304..30534a43f0 100644 --- a/vmware_nsx/db/extended_security_group.py +++ b/vmware_nsx/db/extended_security_group.py @@ -21,15 +21,15 @@ from sqlalchemy.orm import exc from sqlalchemy import sql from neutron.api.v2 import attributes -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron.common import utils as n_utils from neutron.db import api as db_api from neutron.db import db_base_plugin_v2 from neutron.db.models import securitygroup as securitygroups_db from neutron.extensions import securitygroup as ext_sg from neutron_lib.api import validators +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import constants as n_constants from neutron_lib.db import model_base from neutron_lib.utils import helpers diff --git a/vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py index 9da8b40a10..6c42b60bd1 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py @@ -16,10 +16,11 @@ import abc import six -from neutron.callbacks import events -from neutron.callbacks import registry from neutron.db import l3_db from neutron.db import models_v2 +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry + from vmware_nsx._i18n import _ from vmware_nsx.common import exceptions as nsxv_exc from vmware_nsx.common import nsxv_constants diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 17fe7be75f..325ee1b438 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -34,9 +34,6 @@ from sqlalchemy.orm import exc as sa_exc from neutron.api import extensions as neutron_extensions from neutron.api.v2 import attributes as attr -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron.common import ipv6_utils from neutron.common import rpc as n_rpc from neutron.common import topics @@ -80,6 +77,9 @@ 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 portbindings as pbin +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources 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 driver as qos_driver diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 4ce0378a9e..c011889b4a 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -22,10 +22,6 @@ from neutron.api.rpc.handlers import dhcp_rpc from neutron.api.rpc.handlers import metadata_rpc from neutron.api.rpc.handlers import resources_rpc from neutron.api.v2 import attributes -from neutron.callbacks import events -from neutron.callbacks import exceptions as callback_exc -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron.common import rpc as n_rpc from neutron.common import topics from neutron.db import _utils as db_utils @@ -63,6 +59,10 @@ from neutron.services.qos import qos_consts from neutron_lib.api.definitions import portbindings as pbin from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api import validators +from neutron_lib.callbacks import events +from neutron_lib.callbacks import exceptions as callback_exc +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import constants as const from neutron_lib import context as q_context from neutron_lib import exceptions as n_exc diff --git a/vmware_nsx/services/dynamic_routing/bgp_plugin.py b/vmware_nsx/services/dynamic_routing/bgp_plugin.py index 4b6a128de0..8f9136c381 100644 --- a/vmware_nsx/services/dynamic_routing/bgp_plugin.py +++ b/vmware_nsx/services/dynamic_routing/bgp_plugin.py @@ -14,11 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron_dynamic_routing.db import bgp_db from neutron_dynamic_routing.extensions import bgp as bgp_ext +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import context as n_context from neutron_lib.services import base as service_base diff --git a/vmware_nsx/services/flowclassifier/nsx_v/driver.py b/vmware_nsx/services/flowclassifier/nsx_v/driver.py index f5fd0b8070..7b3f205194 100644 --- a/vmware_nsx/services/flowclassifier/nsx_v/driver.py +++ b/vmware_nsx/services/flowclassifier/nsx_v/driver.py @@ -19,9 +19,9 @@ import xml.etree.ElementTree as et from networking_sfc.extensions import flowclassifier from networking_sfc.services.flowclassifier.common import exceptions as exc from networking_sfc.services.flowclassifier.drivers import base as fc_driver -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import context as n_context from neutron_lib.plugins import directory from oslo_config import cfg diff --git a/vmware_nsx/services/l2gateway/nsx_v3/driver.py b/vmware_nsx/services/l2gateway/nsx_v3/driver.py index 567ac63bfc..d9cfa00761 100644 --- a/vmware_nsx/services/l2gateway/nsx_v3/driver.py +++ b/vmware_nsx/services/l2gateway/nsx_v3/driver.py @@ -23,11 +23,11 @@ from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import uuidutils -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron.plugins.common import utils as n_utils from neutron_lib.api.definitions import provider_net as providernet +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import constants from neutron_lib import context from neutron_lib import exceptions as n_exc diff --git a/vmware_nsx/services/lbaas/nsx_v/v2/loadbalancer_mgr.py b/vmware_nsx/services/lbaas/nsx_v/v2/loadbalancer_mgr.py index b8ed123b50..acd3520231 100644 --- a/vmware_nsx/services/lbaas/nsx_v/v2/loadbalancer_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v/v2/loadbalancer_mgr.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from neutron_lib import constants from neutron_lib import exceptions as n_exc from oslo_log import helpers as log_helpers diff --git a/vmware_nsx/services/trunk/nsx_v3/driver.py b/vmware_nsx/services/trunk/nsx_v3/driver.py index 57d92e5c5e..b6e51a9448 100644 --- a/vmware_nsx/services/trunk/nsx_v3/driver.py +++ b/vmware_nsx/services/trunk/nsx_v3/driver.py @@ -18,11 +18,11 @@ from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils -from neutron.callbacks import events -from neutron.callbacks import registry from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk.drivers import base from neutron_lib.api.definitions import portbindings +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry from vmware_nsx.common import nsx_constants as nsx_consts from vmware_nsx.common import utils as nsx_utils diff --git a/vmware_nsx/shell/admin/plugins/common/utils.py b/vmware_nsx/shell/admin/plugins/common/utils.py index 1b9a7544fd..424a3c75df 100644 --- a/vmware_nsx/shell/admin/plugins/common/utils.py +++ b/vmware_nsx/shell/admin/plugins/common/utils.py @@ -18,8 +18,8 @@ import sys from vmware_nsx._i18n import _ from vmware_nsx.shell import resources as nsxadmin -from neutron.callbacks import registry from neutron.common import profiler # noqa +from neutron_lib.callbacks import registry from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/backup_edges.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/backup_edges.py index 37f4805730..59d1709f02 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/backup_edges.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/backup_edges.py @@ -13,8 +13,8 @@ # under the License. -from neutron.callbacks import registry from neutron.db import l3_db +from neutron_lib.callbacks import registry from neutron_lib import exceptions from oslo_log import log as logging from oslo_utils import uuidutils diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/config.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/config.py index 5ca7e1d50d..59e80d8c2a 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/config.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/config.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py index a86418100e..53980bc2fe 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py @@ -24,8 +24,8 @@ import vmware_nsx.shell.admin.plugins.common.utils as admin_utils import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils import vmware_nsx.shell.resources as shell -from neutron.callbacks import registry from neutron.db import l3_db +from neutron_lib.callbacks import registry from vmware_nsx.common import locking from vmware_nsx.db import nsxv_db diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/edges.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/edges.py index 61b181be1c..e686e428ca 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/edges.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/edges.py @@ -25,7 +25,7 @@ import vmware_nsx.shell.admin.plugins.common.utils as admin_utils import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils import vmware_nsx.shell.resources as shell -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import exceptions from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/metadata.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/metadata.py index a98b452670..00e06d7833 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/metadata.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/metadata.py @@ -16,8 +16,8 @@ import hashlib import hmac -from neutron.callbacks import registry from neutron.db import models_v2 +from neutron_lib.callbacks import registry from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py index 568711494b..79fc5fac4b 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py @@ -12,12 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron_lib import context from oslo_log import log as logging from oslo_serialization import jsonutils import re import xml.etree.ElementTree as et +from neutron_lib.callbacks import registry +from neutron_lib import context + from vmware_nsx.db import db as nsx_db from vmware_nsx.plugins.nsx_v.vshield.common import exceptions from vmware_nsx.shell.admin.plugins.common import constants @@ -26,8 +28,6 @@ from vmware_nsx.shell.admin.plugins.common import utils as admin_utils from vmware_nsx.shell.admin.plugins.nsxv.resources import utils as utils from vmware_nsx.shell import resources as shell -from neutron.callbacks import registry - LOG = logging.getLogger(__name__) nsxv = utils.get_nsxv_client() network_types = ['Network', 'VirtualWire', 'DistributedVirtualPortgroup'] diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py index f7694fb67e..ca883b5b4d 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py @@ -18,7 +18,7 @@ import vmware_nsx.shell.admin.plugins.common.utils as admin_utils import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils import vmware_nsx.shell.resources as shell -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import context as n_context from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/securitygroups.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/securitygroups.py index 128bdc5871..faa8731fba 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/securitygroups.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/securitygroups.py @@ -15,12 +15,12 @@ import xml.etree.ElementTree as et -from neutron.callbacks import registry from neutron.db import api as db_api from neutron.db.models import securitygroup as sg_models from neutron.db import models_v2 from neutron.db import securitygroups_db from neutron.extensions import securitygroup as ext_sg +from neutron_lib.callbacks import registry from neutron_lib import context as n_context from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py index 90f8754992..10b6fc07ec 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py @@ -20,7 +20,7 @@ import vmware_nsx.shell.admin.plugins.common.utils as admin_utils import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils import vmware_nsx.shell.resources as shell -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import exceptions from vmware_nsx.db import nsxv_db diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py index 4f79e09937..2a0a4c90e1 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py @@ -23,7 +23,7 @@ from vmware_nsx.shell import resources as shell from vmware_nsxlib.v3 import client_cert from vmware_nsxlib.v3 import trust_management -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import context from neutron_lib import exceptions from oslo_config import cfg diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/config.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/config.py index 4996d58e0d..0b9df5425a 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/config.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/config.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from oslo_log import log as logging from vmware_nsx.shell.admin.plugins.common import constants diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_binding.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_binding.py index 874ac92066..28475ddb7b 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_binding.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_binding.py @@ -14,7 +14,7 @@ import netaddr -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import constants as const from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_servers.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_servers.py index 62185a99cc..2b9d453d3c 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_servers.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/dhcp_servers.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import context from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/metadata_proxy.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/metadata_proxy.py index d30051ad38..866960d74f 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/metadata_proxy.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/metadata_proxy.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import registry +from neutron_lib.callbacks import registry from neutron_lib import constants as const from oslo_config import cfg from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py index 005012ca5c..e3a1eca4a4 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py @@ -21,8 +21,8 @@ from vmware_nsx.shell.admin.plugins.nsxv3.resources import utils from vmware_nsx.shell import resources as shell from vmware_nsxlib.v3 import exceptions as nsx_exc -from neutron.callbacks import registry from neutron.db import db_base_plugin_v2 +from neutron_lib.callbacks import registry from neutron_lib import context as neutron_context from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/ports.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/ports.py index 7a6abab089..b0a000d2ba 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/ports.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/ports.py @@ -30,11 +30,11 @@ from vmware_nsx.shell import resources as shell from vmware_nsxlib.v3 import exceptions as nsx_exc from vmware_nsxlib.v3 import resources -from neutron.callbacks import registry from neutron.db import allowedaddresspairs_db as addr_pair_db from neutron.db import db_base_plugin_v2 from neutron.db import portsecurity_db from neutron.extensions import allowedaddresspairs +from neutron_lib.callbacks import registry from neutron_lib import constants as const from neutron_lib import context as neutron_context from neutron_lib.plugins import directory diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py index aa0d432281..50117cb026 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py @@ -22,9 +22,9 @@ from vmware_nsx.shell import resources as shell from vmware_nsxlib.v3 import exceptions as nsx_exc from vmware_nsxlib.v3 import resources as nsx_resources -from neutron.callbacks import registry from neutron.db import db_base_plugin_v2 from neutron.db import l3_db +from neutron_lib.callbacks import registry from neutron_lib import context as neutron_context from oslo_log import log as logging diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/securitygroups.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/securitygroups.py index 06f2c58d47..2439f2c2f8 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/securitygroups.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/securitygroups.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.callbacks import registry from neutron.db import api as db_api from neutron.db import common_db_mixin as common_db from neutron.db.models import securitygroup from neutron.db import securitygroups_db +from neutron_lib.callbacks import registry from neutron_lib import context as neutron_context from oslo_log import log as logging diff --git a/vmware_nsx/shell/nsxadmin.py b/vmware_nsx/shell/nsxadmin.py index 82d81c2c52..0290c02d60 100644 --- a/vmware_nsx/shell/nsxadmin.py +++ b/vmware_nsx/shell/nsxadmin.py @@ -27,9 +27,9 @@ TODO: Autocomplete command line args import requests import sys -from neutron.callbacks import registry from neutron.common import config as neutron_config from neutron.conf import common as neutron_common_config +from neutron_lib.callbacks import registry from vmware_nsx.common import config # noqa diff --git a/vmware_nsx/tests/unit/services/l2gateway/test_nsxv3_driver.py b/vmware_nsx/tests/unit/services/l2gateway/test_nsxv3_driver.py index e45cd39056..566df0db3a 100644 --- a/vmware_nsx/tests/unit/services/l2gateway/test_nsxv3_driver.py +++ b/vmware_nsx/tests/unit/services/l2gateway/test_nsxv3_driver.py @@ -20,17 +20,17 @@ from networking_l2gw.services.l2gateway.common import constants from networking_l2gw.services.l2gateway import exceptions as l2gw_exc from networking_l2gw.services.l2gateway import plugin as core_l2gw_plugin from networking_l2gw.tests.unit.db import test_l2gw_db -from neutron_lib import context from oslo_config import cfg from oslo_utils import importutils from oslo_utils import uuidutils -from neutron.callbacks import events -from neutron.callbacks import registry -from neutron.callbacks import resources from neutron.tests import base - +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources +from neutron_lib import context from neutron_lib import exceptions as n_exc + from vmware_nsx.services.l2gateway.nsx_v3 import driver as nsx_v3_driver from vmware_nsx.tests.unit.nsx_v3 import test_plugin as test_nsx_v3_plugin from vmware_nsxlib.tests.unit.v3 import mocks as nsx_v3_mocks diff --git a/vmware_nsx/tests/unit/shell/test_admin_utils.py b/vmware_nsx/tests/unit/shell/test_admin_utils.py index bdc8d3d90e..922668a6da 100644 --- a/vmware_nsx/tests/unit/shell/test_admin_utils.py +++ b/vmware_nsx/tests/unit/shell/test_admin_utils.py @@ -22,12 +22,12 @@ from oslo_log import _options from oslo_log import log as logging from oslo_utils import uuidutils -from neutron.callbacks import registry from neutron.common import config as neutron_config from neutron.db import servicetype_db # noqa from neutron.quota import resource_registry from neutron.tests import base from neutron.tests.unit.api import test_extensions +from neutron_lib.callbacks import registry from vmware_nsx._i18n import _ from vmware_nsx.common import config # noqa