From 77821190873a415e2fef445474d997103c8d5651 Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Thu, 13 Feb 2014 16:57:19 -0800 Subject: [PATCH] Renaming plugin-specific exceptions to match NSX Try to get rid of Nvp as much as possible, the base class already uses the plugin short name so it's pointless to carry it over. Partial-implements blueprint nicira-plugin-renaming Change-Id: Ic3e53bc4e41ffe1a19ea03e807ec89bb6c864f51 --- neutron/plugins/nicira/NeutronPlugin.py | 58 ++++++++--------- .../plugins/nicira/NeutronServicePlugin.py | 14 ++--- neutron/plugins/nicira/common/exceptions.py | 63 ++++++++----------- neutron/plugins/nicira/common/sync.py | 4 +- neutron/plugins/nicira/dbexts/vcns_db.py | 14 ++--- .../plugins/nicira/dhcp_meta/lsnmanager.py | 20 +++--- neutron/plugins/nicira/dhcp_meta/nsx.py | 4 +- neutron/plugins/nicira/dhcp_meta/rpc.py | 8 +-- neutron/plugins/nicira/dhcpmeta_modes.py | 6 +- neutron/plugins/nicira/nsx_cluster.py | 2 +- neutron/plugins/nicira/nsxlib/l2gateway.py | 2 +- neutron/plugins/nicira/nsxlib/lsn.py | 4 +- neutron/plugins/nicira/nsxlib/router.py | 18 +++--- neutron/plugins/nicira/nsxlib/switch.py | 4 +- neutron/plugins/nicira/nvplib.py | 4 +- .../tests/unit/vmware/nsxlib/test_router.py | 14 ++--- neutron/tests/unit/vmware/test_dhcpmeta.py | 18 +++--- neutron/tests/unit/vmware/test_nsx_opts.py | 6 +- 18 files changed, 127 insertions(+), 136 deletions(-) diff --git a/neutron/plugins/nicira/NeutronPlugin.py b/neutron/plugins/nicira/NeutronPlugin.py index 49897c7dd..4a9568b83 100644 --- a/neutron/plugins/nicira/NeutronPlugin.py +++ b/neutron/plugins/nicira/NeutronPlugin.py @@ -63,7 +63,7 @@ from neutron.openstack.common import lockutils from neutron.plugins.common import constants as plugin_const from neutron.plugins.nicira.api_client import exception as api_exc from neutron.plugins.nicira.common import config # noqa -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import nsx_utils from neutron.plugins.nicira.common import securitygroups as sg_utils from neutron.plugins.nicira.common import sync @@ -265,9 +265,9 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, port_data.get('mac_address')) LOG.debug(_("Created NVP router port:%s"), lrouter_port['uuid']) except api_exc.NsxApiException: - LOG.exception(_("Unable to create port on NVP logical router %s"), + LOG.exception(_("Unable to create port on NSX logical router %s"), nsx_router_id) - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=_("Unable to create logical router port for neutron " "port id %(port_id)s on router %(nsx_router_id)s") % {'port_id': port_data.get('id'), @@ -357,7 +357,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, "Neutron %(q_port_id)s"), {'r_port_id': nsx_router_port_id, 'q_port_id': port_data.get('id')}) - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("Unable to plug attachment in router port " "%(r_port_id)s for neutron port id %(q_port_id)s " "on router %(router_id)s") % @@ -407,7 +407,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, err_desc = _("An exception occurred while selecting logical " "switch for the port") LOG.exception(err_desc) - raise nvp_exc.NvpPluginException(err_msg=err_desc) + raise nsx_exc.NsxPluginException(err_msg=err_desc) def _nvp_create_port_helper(self, session, ls_uuid, port_data, do_port_security=True): @@ -562,7 +562,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, """Driver for creating a switch port to be connected to a router.""" # No router ports on external networks! if self._network_is_external(context, port_data['network_id']): - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("It is not allowed to create router interface " "ports on external networks as '%s'") % port_data['network_id'])) @@ -610,7 +610,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, lr_port = routerlib.find_router_gw_port(context, self.cluster, nsx_router_id) if not lr_port: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("The gateway port for the NSX router %s " "was not found on the backend") % nsx_router_id)) @@ -686,11 +686,11 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.cluster.default_l3_gw_service_uuid) except api_exc.ResourceNotFound: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=_("Logical router resource %s not found " "on NVP platform") % router_id) except api_exc.NsxApiException: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=_("Unable to update logical router" "on NVP Platform")) LOG.debug(_("_nvp_delete_ext_gw_port completed on external network " @@ -755,11 +755,11 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, Exceptions specific to the NVP Plugin are mapped to standard HTTP Exceptions. """ - base.FAULT_MAP.update({nvp_exc.NvpInvalidNovaZone: + base.FAULT_MAP.update({nsx_exc.InvalidNovaZone: webob.exc.HTTPBadRequest, - nvp_exc.NvpNoMorePortsException: + nsx_exc.NoMorePortsException: webob.exc.HTTPBadRequest, - nvp_exc.MaintenanceInProgress: + nsx_exc.MaintenanceInProgress: webob.exc.HTTPServiceUnavailable}) def _validate_provider_create(self, context, network): @@ -890,7 +890,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, else: LOG.error(_("Maximum number of logical ports reached for " "logical network %s"), network.id) - raise nvp_exc.NvpNoMorePortsException(network=network.id) + raise nsx_exc.NoMorePortsException(network=network.id) def _convert_to_nvp_transport_zones(self, cluster, network=None, bindings=None): @@ -1410,7 +1410,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.cluster, router['id'], tenant_id, router['name'], nexthop, distributed=attr.is_attr_set(distributed) and distributed) - except nvp_exc.NvpInvalidVersion: + except nsx_exc.InvalidVersion: msg = _("Cannot create a distributed router with the NVP " "platform currently in execution. Please, try " "without specifying the 'distributed' attribute.") @@ -1419,7 +1419,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, except api_exc.NsxApiException: err_msg = _("Unable to create logical router on NVP Platform") LOG.exception(err_msg) - raise nvp_exc.NvpPluginException(err_msg=err_msg) + raise nsx_exc.NsxPluginException(err_msg=err_msg) # Create the port here - and update it later if we have gw_info try: @@ -1427,7 +1427,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.cluster, context, lrouter['uuid'], {'fake_ext_gw': True}, "L3GatewayAttachment", self.cluster.default_l3_gw_service_uuid) - except nvp_exc.NvpPluginException: + except nsx_exc.NsxPluginException: LOG.exception(_("Unable to create L3GW port on logical router " "%(router_uuid)s. Verify Default Layer-3 Gateway " "service %(def_l3_gw_svc)s id is correct"), @@ -1437,7 +1437,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, # Try and remove logical router from NVP routerlib.delete_lrouter(self.cluster, lrouter['uuid']) # Return user a 500 with an apter message - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("Unable to create router %s on NSX backend") % router['id'])) lrouter['status'] = plugin_const.ACTIVE @@ -1576,13 +1576,13 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, with context.session.begin(subtransactions=True): router_db = self._get_router(context, router_id) router_db['status'] = constants.NET_STATUS_ERROR - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=_("Logical router %s not found " "on NVP Platform") % router_id) except api_exc.NsxApiException: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=_("Unable to update logical router on NVP Platform")) - except nvp_exc.NvpInvalidVersion: + except nsx_exc.InvalidVersion: msg = _("Request cannot contain 'routes' with the NVP " "platform currently in execution. Please, try " "without specifying the static routes.") @@ -1643,7 +1643,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, LOG.warning(_("Logical router '%s' not found " "on NVP Platform"), router_id) except api_exc.NsxApiException: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("Unable to delete logical router '%s' " "on NVP Platform") % nsx_router_id)) # Remove the NSX mapping first in order to ensure a mapping to @@ -1784,11 +1784,11 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, max_num_expected=1, min_num_expected=0, destination_ip_addresses=subnet['cidr']) except api_exc.ResourceNotFound: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("Logical router resource %s not found " "on NVP platform") % router_id)) except api_exc.NsxApiException: - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( err_msg=(_("Unable to update logical router" "on NVP Platform"))) return info @@ -1824,7 +1824,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, "on the NVP platform for floating ip:%s"), floating_ip_address) raise - except nvp_exc.NvpNatRuleMismatch: + except nsx_exc.NatRuleMismatch: # Do not surface to the user LOG.warning(_("An incorrect number of matching NAT rules " "was found on the NVP platform")) @@ -1965,7 +1965,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, {'floating_ip': floating_ip, 'internal_ip': internal_ip}) msg = _("Failed to update NAT rules for floatingip update") - raise nvp_exc.NvpPluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) floatingip_db.update({'fixed_ip_address': internal_ip, 'fixed_port_id': port_id, @@ -2027,11 +2027,11 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.cluster, tenant_id, gw_data['name'], devices) nsx_uuid = nsx_res.get('uuid') except api_exc.Conflict: - raise nvp_exc.NvpL2GatewayAlreadyInUse(gateway=gw_data['name']) + raise nsx_exc.L2GatewayAlreadyInUse(gateway=gw_data['name']) except api_exc.NsxApiException: err_msg = _("Unable to create l2_gw_service for: %s") % gw_data LOG.exception(err_msg) - raise nvp_exc.NvpPluginException(err_msg=err_msg) + raise nsx_exc.NsxPluginException(err_msg=err_msg) gw_data['id'] = nsx_uuid return super(NvpPluginV2, self).create_network_gateway(context, network_gateway) @@ -2095,7 +2095,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, return super(NvpPluginV2, self).connect_network( context, network_gateway_id, network_mapping_info) except api_exc.Conflict: - raise nvp_exc.NvpL2GatewayAlreadyInUse(gateway=network_gateway_id) + raise nsx_exc.L2GatewayAlreadyInUse(gateway=network_gateway_id) def disconnect_network(self, context, network_gateway_id, network_mapping_info): @@ -2170,7 +2170,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, "%(sec_group_id)s"), {'sec_profile_id': nsx_sec_profile_id, 'sec_group_id': security_group_id}) - raise nvp_exc.NvpPluginException( + raise nsx_exc.NsxPluginException( _("Unable to remove security group %s from backend"), security_group['id']) return super(NvpPluginV2, self).delete_security_group( diff --git a/neutron/plugins/nicira/NeutronServicePlugin.py b/neutron/plugins/nicira/NeutronServicePlugin.py index 098bee5a2..af54a2442 100644 --- a/neutron/plugins/nicira/NeutronServicePlugin.py +++ b/neutron/plugins/nicira/NeutronServicePlugin.py @@ -32,7 +32,7 @@ from neutron.openstack.common import log as logging from neutron.plugins.common import constants as service_constants from neutron.plugins.nicira.api_client import exception as api_exc from neutron.plugins.nicira.common import config # noqa -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import utils from neutron.plugins.nicira.dbexts import servicerouter as sr_db from neutron.plugins.nicira.dbexts import vcns_db @@ -882,7 +882,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, context, firewall_db.Firewall, router_id=router_id): msg = _("A firewall is already associated with the router") LOG.error(msg) - raise nvp_exc.NvpServiceOverQuota( + raise nsx_exc.ServiceOverQuota( overs='firewall', err_msg=msg) fw = super(NvpAdvancedPlugin, self).create_firewall(context, firewall) @@ -1119,7 +1119,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, {'model': model, 'id': id}) LOG.error(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) else: res.status = status except sa_exc.NoResultFound: @@ -1127,7 +1127,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, {'model': model, 'id': id}) LOG.exception(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) if obj: obj['status'] = status @@ -1194,7 +1194,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, if not self._is_advanced_service_router(context, router_id): msg = _("router_id: %s is not an advanced router!") % router_id LOG.error(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) #Check whether the vip port is an external port subnet_id = vip['vip']['subnet_id'] @@ -1203,7 +1203,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, if not ext_net.external: msg = (_("Network '%s' is not a valid external " "network") % network_id) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) v = super(NvpAdvancedPlugin, self).create_vip(context, vip) #Get edge_id for the resource @@ -1504,7 +1504,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin, msg = _("Vcns right now can only support " "one monitor per pool") LOG.error(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) #Check whether the pool is already associated with the vip if not pool.get('vip_id'): res = super(NvpAdvancedPlugin, diff --git a/neutron/plugins/nicira/common/exceptions.py b/neutron/plugins/nicira/common/exceptions.py index d4b67cc4f..cb2cf8660 100644 --- a/neutron/plugins/nicira/common/exceptions.py +++ b/neutron/plugins/nicira/common/exceptions.py @@ -1,6 +1,5 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2012 Nicira Networks, Inc +# Copyright 2012 VMware, Inc +# # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -15,79 +14,71 @@ # License for the specific language governing permissions and limitations # under the License. -"""NVP Plugin exceptions""" - -from neutron.common import exceptions as q_exc +from neutron.common import exceptions as n_exc -class NvpPluginException(q_exc.NeutronException): - message = _("An unexpected error occurred in the NVP Plugin:%(err_msg)s") +class NsxPluginException(n_exc.NeutronException): + message = _("An unexpected error occurred in the NSX Plugin: %(err_msg)s") -class NvpInvalidVersion(NvpPluginException): +class InvalidVersion(NsxPluginException): message = _("Unable to fulfill request with version %(version)s.") -class NvpInvalidConnection(NvpPluginException): - message = _("Invalid NVP connection parameters: %(conn_params)s") +class InvalidConnection(NsxPluginException): + message = _("Invalid NSX connection parameters: %(conn_params)s") -class NvpInvalidClusterConfiguration(NvpPluginException): +class InvalidClusterConfiguration(NsxPluginException): message = _("Invalid cluster values: %(invalid_attrs)s. Please ensure " "that these values are specified in the [DEFAULT] " - "section of the nvp plugin ini file.") + "section of the NSX plugin ini file.") -class NvpInvalidNovaZone(NvpPluginException): +class InvalidNovaZone(NsxPluginException): message = _("Unable to find cluster config entry " "for nova zone: %(nova_zone)s") -class NvpNoMorePortsException(NvpPluginException): +class NoMorePortsException(NsxPluginException): message = _("Unable to create port on network %(network)s. " "Maximum number of ports reached") -class NvpNatRuleMismatch(NvpPluginException): +class NatRuleMismatch(NsxPluginException): message = _("While retrieving NAT rules, %(actual_rules)s were found " "whereas rules in the (%(min_rules)s,%(max_rules)s) interval " "were expected") -class NvpInvalidAttachmentType(NvpPluginException): - message = _("Invalid NVP attachment type '%(attachment_type)s'") +class InvalidAttachmentType(NsxPluginException): + message = _("Invalid NSX attachment type '%(attachment_type)s'") -class MaintenanceInProgress(NvpPluginException): +class MaintenanceInProgress(NsxPluginException): message = _("The networking backend is currently in maintenance mode and " "therefore unable to accept requests which modify its state. " "Please try later.") -class NvpServicePluginException(q_exc.NeutronException): - """NVP Service Plugin exceptions.""" - message = _("An unexpected error happened " - "in the NVP Service Plugin: %(err_msg)s") - - -class NvpL2GatewayAlreadyInUse(q_exc.Conflict): +class L2GatewayAlreadyInUse(n_exc.Conflict): message = _("Gateway Service %(gateway)s is already in use") -class NvpServiceOverQuota(q_exc.Conflict): +class ServiceOverQuota(n_exc.Conflict): message = _("Quota exceeded for Vcns resource: %(overs)s: %(err_msg)s") -class NvpVcnsDriverException(NvpServicePluginException): - message = _("Error happened in NVP VCNS Driver: %(err_msg)s") +class VcnsDriverException(NsxPluginException): + message = _("Error happened in NSX VCNS Driver: %(err_msg)s") -class ServiceClusterUnavailable(NvpPluginException): +class ServiceClusterUnavailable(NsxPluginException): message = _("Service cluster: '%(cluster_id)s' is unavailable. Please, " - "check NVP setup and/or configuration") + "check NSX setup and/or configuration") -class PortConfigurationError(NvpPluginException): +class PortConfigurationError(NsxPluginException): message = _("An error occurred while connecting LSN %(lsn_id)s " "and network %(net_id)s via port %(port_id)s") @@ -96,18 +87,18 @@ class PortConfigurationError(NvpPluginException): self.port_id = kwargs.get('port_id') -class LsnNotFound(q_exc.NotFound): +class LsnNotFound(n_exc.NotFound): message = _('Unable to find LSN for %(entity)s %(entity_id)s') -class LsnPortNotFound(q_exc.NotFound): +class LsnPortNotFound(n_exc.NotFound): message = (_('Unable to find port for LSN %(lsn_id)s ' 'and %(entity)s %(entity_id)s')) -class LsnMigrationConflict(q_exc.Conflict): +class LsnMigrationConflict(n_exc.Conflict): message = _("Unable to migrate network '%(net_id)s' to LSN: %(reason)s") -class LsnConfigurationConflict(NvpPluginException): +class LsnConfigurationConflict(NsxPluginException): message = _("Configuration conflict on Logical Service Node %(lsn_id)s") diff --git a/neutron/plugins/nicira/common/sync.py b/neutron/plugins/nicira/common/sync.py index f6e0c3f5a..d44997dfc 100644 --- a/neutron/plugins/nicira/common/sync.py +++ b/neutron/plugins/nicira/common/sync.py @@ -26,7 +26,7 @@ from neutron.openstack.common import log from neutron.openstack.common import loopingcall from neutron.openstack.common import timeutils from neutron.plugins.nicira.api_client import exception as api_exc -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import nsx_utils from neutron.plugins.nicira.nsxlib import router as routerlib from neutron.plugins.nicira.nsxlib import switch as switchlib @@ -224,7 +224,7 @@ class NvpSynchronizer(): {'req_delay': self._req_delay, 'sync_interval': self._sync_interval}) LOG.error(err_msg) - raise nvp_exc.NvpPluginException(err_msg=err_msg) + raise nsx_exc.NsxPluginException(err_msg=err_msg) # Backoff time in case of failures while fetching sync data self._sync_backoff = 1 # Store the looping call in an instance variable to allow unit tests diff --git a/neutron/plugins/nicira/dbexts/vcns_db.py b/neutron/plugins/nicira/dbexts/vcns_db.py index e34d2efc6..069e925f0 100644 --- a/neutron/plugins/nicira/dbexts/vcns_db.py +++ b/neutron/plugins/nicira/dbexts/vcns_db.py @@ -17,7 +17,7 @@ from sqlalchemy.orm import exc from neutron.openstack.common import log as logging -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.dbexts import vcns_models from neutron.plugins.nicira.vshield.common import ( exceptions as vcns_exc) @@ -75,7 +75,7 @@ def delete_vcns_edge_firewallrule_binding(session, id): if not (session.query(vcns_models.VcnsEdgeFirewallRuleBinding). filter_by(rule_id=id).delete()): msg = _("Rule Resource binding with id:%s not found!") % id - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) def get_vcns_edge_firewallrule_binding(session, id, edge_id): @@ -92,7 +92,7 @@ def get_vcns_edge_firewallrule_binding_by_vseid( filter_by(edge_id=edge_id, rule_vseid=rule_vseid).one()) except exc.NoResultFound: msg = _("Rule Resource binding not found!") - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) def cleanup_vcns_edge_firewallrule_binding(session, edge_id): @@ -132,7 +132,7 @@ def delete_vcns_edge_vip_binding(session, id): if not qry.filter_by(vip_id=id).delete(): msg = _("VIP Resource binding with id:%s not found!") % id LOG.exception(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) def add_vcns_edge_pool_binding(session, map_info): @@ -163,7 +163,7 @@ def get_vcns_edge_pool_binding_by_vseid(session, edge_id, pool_vseid): "pool_vseid:%(pool_vseid)s not found!") % {'edge_id': edge_id, 'pool_vseid': pool_vseid}) LOG.exception(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) return binding @@ -173,7 +173,7 @@ def delete_vcns_edge_pool_binding(session, id, edge_id): if not qry.filter_by(pool_id=id, edge_id=edge_id).delete(): msg = _("Pool Resource binding with id:%s not found!") % id LOG.exception(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) def add_vcns_edge_monitor_binding(session, map_info): @@ -199,4 +199,4 @@ def delete_vcns_edge_monitor_binding(session, id, edge_id): if not qry.filter_by(monitor_id=id, edge_id=edge_id).delete(): msg = _("Monitor Resource binding with id:%s not found!") % id LOG.exception(msg) - raise nvp_exc.NvpServicePluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) diff --git a/neutron/plugins/nicira/dhcp_meta/lsnmanager.py b/neutron/plugins/nicira/dhcp_meta/lsnmanager.py index b971b6b40..71f3cc596 100644 --- a/neutron/plugins/nicira/dhcp_meta/lsnmanager.py +++ b/neutron/plugins/nicira/dhcp_meta/lsnmanager.py @@ -78,7 +78,7 @@ class LsnManager(object): return lsn_api.lsn_for_network_create(self.cluster, network_id) except api_exc.NsxApiException: err_msg = _('Unable to create LSN for network %s') % network_id - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) def lsn_delete(self, context, lsn_id): """Delete a LSN given its id.""" @@ -145,7 +145,7 @@ class LsnManager(object): raise p_exc.LsnNotFound(entity='', entity_id=lsn_id) except api_exc.NsxApiException: err_msg = _('Unable to create port for LSN %s') % lsn_id - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) def lsn_port_delete(self, context, lsn_id, lsn_port_id): """Delete a LSN port from the Logical Service Node.""" @@ -184,7 +184,7 @@ class LsnManager(object): self.cluster, network_id, port_id)['uuid'] lsn_id = self.lsn_get(context, network_id) lsn_port_id = self.lsn_port_create(context, lsn_id, port_data) - except (n_exc.NotFound, p_exc.NvpPluginException): + except (n_exc.NotFound, p_exc.NsxPluginException): raise p_exc.PortConfigurationError( net_id=network_id, lsn_id=lsn_id, port_id=port_id) else: @@ -217,7 +217,7 @@ class LsnManager(object): const.METADATA_PORT_ID, const.METADATA_PORT_NAME, const.METADATA_DEVICE_ID, True)['uuid'] lsn_port_id = self.lsn_port_create(self.cluster, lsn_id, data) - except (n_exc.NotFound, p_exc.NvpPluginException, + except (n_exc.NotFound, p_exc.NsxPluginException, api_exc.NsxApiException): raise p_exc.PortConfigurationError( net_id=network_id, lsn_id=lsn_id, port_id=lswitch_port_id) @@ -257,7 +257,7 @@ class LsnManager(object): 'Node %(lsn_id)s and port %(lsn_port_id)s') % {'lsn_id': lsn_id, 'lsn_port_id': lsn_port_id}) LOG.error(err_msg) - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) def lsn_metadata_configure(self, context, subnet_id, is_enabled): """Configure metadata service for the specified subnet.""" @@ -277,7 +277,7 @@ class LsnManager(object): err_msg = (_('Unable to configure metadata ' 'for subnet %s') % subnet_id) LOG.error(err_msg) - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) if is_enabled: try: # test that the lsn port exists @@ -369,14 +369,14 @@ class PersistentLsnManager(LsnManager): except db_exc.DBError: err_msg = _('Unable to save LSN for network %s') % network_id LOG.exception(err_msg) - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) def lsn_create(self, context, network_id): lsn_id = super(PersistentLsnManager, self).lsn_create(context, network_id) try: self.lsn_save(context, network_id, lsn_id) - except p_exc.NvpPluginException: + except p_exc.NsxPluginException: super(PersistentLsnManager, self).lsn_delete(context, lsn_id) raise return lsn_id @@ -431,7 +431,7 @@ class PersistentLsnManager(LsnManager): except db_exc.DBError: err_msg = _('Unable to save LSN port for subnet %s') % subnet_id LOG.exception(err_msg) - raise p_exc.NvpPluginException(err_msg=err_msg) + raise p_exc.NsxPluginException(err_msg=err_msg) def lsn_port_create(self, context, lsn_id, subnet_info): lsn_port_id = super(PersistentLsnManager, @@ -439,7 +439,7 @@ class PersistentLsnManager(LsnManager): try: self.lsn_port_save(context, lsn_port_id, subnet_info['subnet_id'], subnet_info['mac_address'], lsn_id) - except p_exc.NvpPluginException: + except p_exc.NsxPluginException: super(PersistentLsnManager, self).lsn_port_delete( context, lsn_id, lsn_port_id) raise diff --git a/neutron/plugins/nicira/dhcp_meta/nsx.py b/neutron/plugins/nicira/dhcp_meta/nsx.py index 30add73c1..75bb7bf11 100644 --- a/neutron/plugins/nicira/dhcp_meta/nsx.py +++ b/neutron/plugins/nicira/dhcp_meta/nsx.py @@ -198,7 +198,7 @@ def check_services_requirements(cluster): if not lsn_api.service_cluster_exists(cluster, cluster_id): raise p_exc.ServiceClusterUnavailable(cluster_id=cluster_id) else: - raise p_exc.NvpInvalidVersion(version=ver) + raise p_exc.InvalidVersion(version=ver) def handle_network_dhcp_access(plugin, context, network, action): @@ -309,7 +309,7 @@ def handle_router_metadata_access(plugin, context, router_id, interface=None): try: plugin.lsn_manager.lsn_metadata_configure( context, subnet_id, is_enabled) - except p_exc.NvpPluginException: + except p_exc.NsxPluginException: if is_enabled: l3_db.L3_NAT_db_mixin.remove_router_interface( plugin, context, router_id, interface) diff --git a/neutron/plugins/nicira/dhcp_meta/rpc.py b/neutron/plugins/nicira/dhcp_meta/rpc.py index ada4ef755..218a28317 100644 --- a/neutron/plugins/nicira/dhcp_meta/rpc.py +++ b/neutron/plugins/nicira/dhcp_meta/rpc.py @@ -33,7 +33,7 @@ from neutron.db import models_v2 from neutron.openstack.common import log as logging from neutron.plugins.nicira.api_client import exception as api_exc from neutron.plugins.nicira.common import config -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc LOG = logging.getLogger(__name__) @@ -135,7 +135,7 @@ def handle_router_metadata_access(plugin, context, router_id, interface=None): "created or destroyed"), router_id) # TODO(salvatore-orlando): A better exception handling in the # NSX plugin would allow us to improve error handling here - except (ntn_exc.NeutronException, nvp_exc.NvpPluginException, + except (ntn_exc.NeutronException, nsx_exc.NsxPluginException, api_exc.NsxApiException): # Any exception here should be regarded as non-fatal LOG.exception(_("An error occurred while operating on the " @@ -188,7 +188,7 @@ def _create_metadata_access_network(plugin, context, router_id): {'subnet_id': meta_sub['id']}) greenthread.sleep(0) # yield except (ntn_exc.NeutronException, - nvp_exc.NvpPluginException, + nsx_exc.NsxPluginException, api_exc.NsxApiException): # It is not necessary to explicitly delete the subnet # as it will be removed with the network @@ -214,7 +214,7 @@ def _destroy_metadata_access_network(plugin, context, router_id, ports): # Remove network (this will remove the subnet too) plugin.delete_network(context, meta_net_id) greenthread.sleep(0) # yield - except (ntn_exc.NeutronException, nvp_exc.NvpPluginException, + except (ntn_exc.NeutronException, nsx_exc.NsxPluginException, api_exc.NsxApiException): # must re-add the router interface plugin.add_router_interface(context, router_id, diff --git a/neutron/plugins/nicira/dhcpmeta_modes.py b/neutron/plugins/nicira/dhcpmeta_modes.py index 4e63abf26..1d5a33192 100644 --- a/neutron/plugins/nicira/dhcpmeta_modes.py +++ b/neutron/plugins/nicira/dhcpmeta_modes.py @@ -53,7 +53,7 @@ class DhcpMetadataAccess(object): else: error = _("Invalid agent_mode: %s") % cfg.CONF.NSX.agent_mode LOG.error(error) - raise nsx_exc.NvpPluginException(err_msg=error) + raise nsx_exc.NsxPluginException(err_msg=error) self.handle_network_dhcp_access_delegate = ( mod.handle_network_dhcp_access ) @@ -118,7 +118,7 @@ class DhcpMetadataAccess(object): try: error = None nsx_svc.check_services_requirements(self.cluster) - except nsx_exc.NvpInvalidVersion: + except nsx_exc.InvalidVersion: error = _("Unable to run Neutron with config option '%s', as NSX " "does not support it") % cfg.CONF.NSX.agent_mode except nsx_exc.ServiceClusterUnavailable: @@ -126,7 +126,7 @@ class DhcpMetadataAccess(object): "'%s'") % cfg.CONF.NSX.agent_mode if error: LOG.exception(error) - raise nsx_exc.NvpPluginException(err_msg=error) + raise nsx_exc.NsxPluginException(err_msg=error) def get_lsn(self, context, network_id, fields=None): report = self.migration_manager.report(context, network_id) diff --git a/neutron/plugins/nicira/nsx_cluster.py b/neutron/plugins/nicira/nsx_cluster.py index 15e362436..b2bf35f8e 100644 --- a/neutron/plugins/nicira/nsx_cluster.py +++ b/neutron/plugins/nicira/nsx_cluster.py @@ -60,7 +60,7 @@ class NSXCluster(object): # If everything went according to plan these two lists should be empty if self._required_attributes: - raise exceptions.NvpInvalidClusterConfiguration( + raise exceptions.InvalidClusterConfiguration( invalid_attrs=self._required_attributes) if self._important_attributes: LOG.info(_("The following cluster attributes were " diff --git a/neutron/plugins/nicira/nsxlib/l2gateway.py b/neutron/plugins/nicira/nsxlib/l2gateway.py index 1d866073d..9ab0bb538 100644 --- a/neutron/plugins/nicira/nsxlib/l2gateway.py +++ b/neutron/plugins/nicira/nsxlib/l2gateway.py @@ -42,7 +42,7 @@ def create_l2_gw_service(cluster, tenant_id, display_name, devices): :param display_name: Descriptive name of this gateway service :param devices: List of transport node uuids (and network interfaces on them) to use for the network gateway service - :raise NvpApiException: if there is a problem while communicating + :raise NsxApiException: if there is a problem while communicating with the NSX controller """ # NOTE(salvatore-orlando): This is a little confusing, but device_id in diff --git a/neutron/plugins/nicira/nsxlib/lsn.py b/neutron/plugins/nicira/nsxlib/lsn.py index 3d88fd5b5..f66e9e508 100644 --- a/neutron/plugins/nicira/nsxlib/lsn.py +++ b/neutron/plugins/nicira/nsxlib/lsn.py @@ -20,7 +20,7 @@ import json from neutron.common import exceptions as exception from neutron.openstack.common import log from neutron.plugins.nicira.api_client import exception as api_exc -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import utils from neutron.plugins.nicira.nvplib import _build_uri_path from neutron.plugins.nicira.nvplib import do_request @@ -174,7 +174,7 @@ def lsn_port_plug_network(cluster, lsn_id, lsn_port_id, lswitch_port_id): "already exists with another port") % {'lsn': lsn_id, 'port': lswitch_port_id}) LOG.exception(msg) - raise nvp_exc.LsnConfigurationConflict(lsn_id=lsn_id) + raise nsx_exc.LsnConfigurationConflict(lsn_id=lsn_id) def _lsn_configure_action( diff --git a/neutron/plugins/nicira/nsxlib/router.py b/neutron/plugins/nicira/nsxlib/router.py index c7cd796fd..db4c067a1 100644 --- a/neutron/plugins/nicira/nsxlib/router.py +++ b/neutron/plugins/nicira/nsxlib/router.py @@ -18,7 +18,7 @@ from neutron.openstack.common import excutils from neutron.openstack.common import jsonutils from neutron.openstack.common import log from neutron.plugins.nicira.api_client import exception as api_exc -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import utils from neutron.plugins.nicira.nsxlib.switch import get_port from neutron.plugins.nicira.nsxlib.versioning import DEFAULT_VERSION @@ -427,7 +427,7 @@ def plug_router_port_attachment(cluster, router_id, port_id, if attachment_vlan: attach_obj['vlan_id'] = attachment_vlan else: - raise nvp_exc.NvpInvalidAttachmentType( + raise nsx_exc.InvalidAttachmentType( attachment_type=nsx_attachment_type) return do_request( HTTP_PUT, uri, jsonutils.dumps(attach_obj), cluster=cluster) @@ -556,9 +556,9 @@ def delete_nat_rules_by_match(cluster, router_id, rule_type, to_delete_ids.append(r['uuid']) if not (len(to_delete_ids) in range(min_num_expected, max_num_expected + 1)): - raise nvp_exc.NvpNatRuleMismatch(actual_rules=len(to_delete_ids), - min_rules=min_num_expected, - max_rules=max_num_expected) + raise nsx_exc.NatRuleMismatch(actual_rules=len(to_delete_ids), + min_rules=min_num_expected, + max_rules=max_num_expected) for rule_id in to_delete_ids: delete_router_nat_rule(cluster, router_id, rule_id) @@ -597,12 +597,12 @@ def update_lrouter_port_ips(cluster, lrouter_id, lport_id, msg = (_("Router Port %(lport_id)s not found on router " "%(lrouter_id)s") % data) LOG.exception(msg) - raise nvp_exc.NvpPluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) except api_exc.NsxApiException as e: msg = _("An exception occurred while updating IP addresses on a " "router logical port:%s") % str(e) LOG.exception(msg) - raise nvp_exc.NvpPluginException(err_msg=msg) + raise nsx_exc.NsxPluginException(err_msg=msg) ROUTER_FUNC_DICT = { @@ -638,7 +638,7 @@ def create_lrouter(cluster, *args, **kwargs): if kwargs.get('distributed', None): v = cluster.api_client.get_version() if (v.major, v.minor) < (3, 1): - raise nvp_exc.NvpInvalidVersion(version=v) + raise nsx_exc.InvalidVersion(version=v) return v @@ -652,7 +652,7 @@ def update_lrouter(cluster, *args, **kwargs): if kwargs.get('routes', None): v = cluster.api_client.get_version() if (v.major, v.minor) < (3, 2): - raise nvp_exc.NvpInvalidVersion(version=v) + raise nsx_exc.InvalidVersion(version=v) return v diff --git a/neutron/plugins/nicira/nsxlib/switch.py b/neutron/plugins/nicira/nsxlib/switch.py index 7b6f7005e..058e0d8cd 100644 --- a/neutron/plugins/nicira/nsxlib/switch.py +++ b/neutron/plugins/nicira/nsxlib/switch.py @@ -20,7 +20,7 @@ from neutron.common import constants from neutron.common import exceptions as exception from neutron.openstack.common import log from neutron.plugins.nicira.api_client import exception as api_exc -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc from neutron.plugins.nicira.common import utils from neutron.plugins.nicira.nvplib import _build_uri_path from neutron.plugins.nicira.nvplib import do_request @@ -246,7 +246,7 @@ def get_ports(cluster, networks=None, devices=None, tenants=None): except Exception: err_msg = _("Unable to get ports") LOG.exception(err_msg) - raise nvp_exc.NvpPluginException(err_msg=err_msg) + raise nsx_exc.NsxPluginException(err_msg=err_msg) return nsx_lports diff --git a/neutron/plugins/nicira/nvplib.py b/neutron/plugins/nicira/nvplib.py index 857d2e9c3..f814979ae 100644 --- a/neutron/plugins/nicira/nvplib.py +++ b/neutron/plugins/nicira/nvplib.py @@ -26,7 +26,7 @@ import json from neutron.common import exceptions as exception from neutron.openstack.common import log from neutron.plugins.nicira.api_client import exception as api_exc -from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import exceptions as nsx_exc LOG = log.getLogger(__name__) @@ -145,4 +145,4 @@ def do_request(*args, **kwargs): except api_exc.ResourceNotFound: raise exception.NotFound() except api_exc.ReadOnlyMode: - raise nvp_exc.MaintenanceInProgress() + raise nsx_exc.MaintenanceInProgress() diff --git a/neutron/tests/unit/vmware/nsxlib/test_router.py b/neutron/tests/unit/vmware/nsxlib/test_router.py index b27314025..a5f546317 100644 --- a/neutron/tests/unit/vmware/nsxlib/test_router.py +++ b/neutron/tests/unit/vmware/nsxlib/test_router.py @@ -384,13 +384,13 @@ class TestLogicalRouters(base.NsxlibTestCase): 'foo_nexthop', routes={'foo_destination': 'foo_address'}) def test_version_dependent_update_lrouter_old_versions(self): - self.assertRaises(nsx_exc.NvpInvalidVersion, + self.assertRaises(nsx_exc.InvalidVersion, self._test_version_dependent_update_lrouter, "2.9") - self.assertRaises(nsx_exc.NvpInvalidVersion, + self.assertRaises(nsx_exc.InvalidVersion, self._test_version_dependent_update_lrouter, "3.0") - self.assertRaises(nsx_exc.NvpInvalidVersion, + self.assertRaises(nsx_exc.InvalidVersion, self._test_version_dependent_update_lrouter, "3.1") @@ -658,7 +658,7 @@ class TestLogicalRouters(base.NsxlibTestCase): def test_update_lrouter_port_ips_nonexistent_router_raises(self): self.assertRaises( - nsx_exc.NvpPluginException, routerlib.update_lrouter_port_ips, + nsx_exc.NsxPluginException, routerlib.update_lrouter_port_ips, self.fake_cluster, 'boo-router', 'boo-port', [], []) def test_update_lrouter_port_ips_nsx_exception_raises(self): @@ -676,7 +676,7 @@ class TestLogicalRouters(base.NsxlibTestCase): with mock.patch.object(routerlib, 'do_request', new=raise_nsx_exc): self.assertRaises( - nsx_exc.NvpPluginException, routerlib.update_lrouter_port_ips, + nsx_exc.NsxPluginException, routerlib.update_lrouter_port_ips, self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], [], []) @@ -752,7 +752,7 @@ class TestLogicalRouters(base.NsxlibTestCase): lrouter_port = routerlib.create_router_lport( self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1'], '00:11:22:33:44:55') - self.assertRaises(nsx_exc.NvpInvalidAttachmentType, + self.assertRaises(nsx_exc.InvalidAttachmentType, routerlib.plug_router_port_attachment, self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], 'gw_att', 'BadType') @@ -912,7 +912,7 @@ class TestLogicalRouters(base.NsxlibTestCase): rules = routerlib.query_nat_rules(self.fake_cluster, lrouter['uuid']) self.assertEqual(len(rules), 3) self.assertRaises( - nsx_exc.NvpNatRuleMismatch, + nsx_exc.NatRuleMismatch, routerlib.delete_nat_rules_by_match, self.fake_cluster, lrouter['uuid'], 'SomeWeirdType', 1, 1) diff --git a/neutron/tests/unit/vmware/test_dhcpmeta.py b/neutron/tests/unit/vmware/test_dhcpmeta.py index fed22e168..c55fc3c03 100644 --- a/neutron/tests/unit/vmware/test_dhcpmeta.py +++ b/neutron/tests/unit/vmware/test_dhcpmeta.py @@ -313,7 +313,7 @@ class LsnManagerTestCase(base.BaseTestCase): def test_lsn_create_raise_api_error(self): self.mock_lsn_api.lsn_for_network_create.side_effect = NsxApiException - self.assertRaises(p_exc.NvpPluginException, + self.assertRaises(p_exc.NsxPluginException, self.manager.lsn_create, mock.ANY, self.net_id) self.mock_lsn_api.lsn_for_network_create.assert_called_once_with( @@ -412,7 +412,7 @@ class LsnManagerTestCase(base.BaseTestCase): def test_lsn_port_create_api_exception(self): self._test_lsn_port_create_with_exc(NsxApiException, - p_exc.NvpPluginException) + p_exc.NsxPluginException) def test_lsn_port_delete(self): self.manager.lsn_port_delete(mock.ANY, mock.ANY, mock.ANY) @@ -549,7 +549,7 @@ class LsnManagerTestCase(base.BaseTestCase): p_exc.LsnNotFound(entity='lsn', entity_id=self.lsn_id)) self.manager.plugin.get_subnet.return_value = ( {'network_id': self.net_id}) - self.assertRaises(p_exc.NvpPluginException, + self.assertRaises(p_exc.NsxPluginException, self.manager.lsn_metadata_configure, mock.ANY, self.sub_id, True) @@ -745,8 +745,8 @@ class PersistentLsnManagerTestCase(base.BaseTestCase): def test_lsn_create_failure(self): with mock.patch.object( self.manager, 'lsn_save', - side_effect=p_exc.NvpPluginException(err_msg='')): - self.assertRaises(p_exc.NvpPluginException, + side_effect=p_exc.NsxPluginException(err_msg='')): + self.assertRaises(p_exc.NsxPluginException, self.manager.lsn_create, self.context, self.net_id) self.assertTrue(self.mock_lsn_api.lsn_delete.call_count) @@ -831,8 +831,8 @@ class PersistentLsnManagerTestCase(base.BaseTestCase): subnet = {'subnet_id': self.sub_id, 'mac_address': self.mac} with mock.patch.object( self.manager, 'lsn_port_save', - side_effect=p_exc.NvpPluginException(err_msg='')): - self.assertRaises(p_exc.NvpPluginException, + side_effect=p_exc.NsxPluginException(err_msg='')): + self.assertRaises(p_exc.NsxPluginException, self.manager.lsn_port_create, self.context, self.net_id, subnet) self.assertTrue(self.mock_lsn_api.lsn_port_delete.call_count) @@ -1378,8 +1378,8 @@ class MetadataTestCase(base.BaseTestCase): if raise_exc: with mock.patch.object(nsx.l3_db.L3_NAT_db_mixin, 'remove_router_interface') as d: - mock_func.side_effect = p_exc.NvpPluginException(err_msg='') - self.assertRaises(p_exc.NvpPluginException, + mock_func.side_effect = p_exc.NsxPluginException(err_msg='') + self.assertRaises(p_exc.NsxPluginException, nsx.handle_router_metadata_access, self.plugin, mock.ANY, 'foo_router_id', interface) diff --git a/neutron/tests/unit/vmware/test_nsx_opts.py b/neutron/tests/unit/vmware/test_nsx_opts.py index c499c5be5..b2b7cf49a 100644 --- a/neutron/tests/unit/vmware/test_nsx_opts.py +++ b/neutron/tests/unit/vmware/test_nsx_opts.py @@ -70,7 +70,7 @@ class NSXClusterTest(base.BaseTestCase): def test_create_cluster_missing_required_attribute_raises(self): opts = self.cluster_opts.copy() opts.pop('default_tz_uuid') - self.assertRaises(exceptions.NvpInvalidClusterConfiguration, + self.assertRaises(exceptions.InvalidClusterConfiguration, nsx_cluster.NSXCluster, **opts) @@ -172,7 +172,7 @@ class ConfigurationTest(base.BaseTestCase): with mock.patch.object(client.NsxApiClient, 'get_version', return_value=version.Version("3.2")): - self.assertRaises(exceptions.NvpPluginException, NeutronManager) + self.assertRaises(exceptions.NsxPluginException, NeutronManager) def test_agentless_extensions_unmet_deps_fail(self): q_config.parse(['--config-file', BASE_CONF_PATH, @@ -186,7 +186,7 @@ class ConfigurationTest(base.BaseTestCase): with mock.patch.object(lsnlib, 'service_cluster_exists', return_value=False): - self.assertRaises(exceptions.NvpPluginException, + self.assertRaises(exceptions.NsxPluginException, NeutronManager) def test_agent_extensions(self): -- 2.45.2