From 9a7f7cf7d344db2fe0b73ea5de0b6992c52b46a4 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 14 May 2014 07:23:55 -0700 Subject: [PATCH] NSX: Do not extend fault map for network gateway ext Most of the exceptions defined for this extension already extend an exception-mapped class. This patch ensures this is true for every exception and then removes the fault map extension code. Change-Id: Ifdd9b6d3892cff2d076bdab3a2a1252923e3f85d Closes-Bug: 1319423 --- neutron/plugins/vmware/dbexts/networkgw_db.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/neutron/plugins/vmware/dbexts/networkgw_db.py b/neutron/plugins/vmware/dbexts/networkgw_db.py index dd1ec85f8..b414e2a8a 100644 --- a/neutron/plugins/vmware/dbexts/networkgw_db.py +++ b/neutron/plugins/vmware/dbexts/networkgw_db.py @@ -16,10 +16,8 @@ import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc as sa_orm_exc -from webob import exc as web_exc from neutron.api.v2 import attributes -from neutron.api.v2 import base from neutron.common import exceptions from neutron.db import model_base from neutron.db import models_v2 @@ -71,7 +69,7 @@ class GatewayConnectionInUse(exceptions.InUse): "network gateway '%(gateway_id)s'.") -class MultipleGatewayConnections(exceptions.NeutronException): +class MultipleGatewayConnections(exceptions.Conflict): message = _("Multiple network connections found on '%(gateway_id)s' " "with provided criteria.") @@ -85,13 +83,6 @@ class NetworkGatewayUnchangeable(exceptions.InUse): message = _("The network gateway %(gateway_id)s " "cannot be updated or deleted") -# Add exceptions to HTTP Faults mappings -base.FAULT_MAP.update({GatewayInUse: web_exc.HTTPConflict, - NetworkGatewayPortInUse: web_exc.HTTPConflict, - GatewayConnectionInUse: web_exc.HTTPConflict, - GatewayConnectionNotFound: web_exc.HTTPNotFound, - MultipleGatewayConnections: web_exc.HTTPConflict}) - class NetworkConnection(model_base.BASEV2, models_v2.HasTenant): """Defines a connection between a network gateway and a network.""" -- 2.45.2