]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
NSX: Do not extend fault map for network gateway ext
authorSalvatore Orlando <salv.orlando@gmail.com>
Wed, 14 May 2014 14:23:55 +0000 (07:23 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Wed, 14 May 2014 22:23:15 +0000 (15:23 -0700)
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

index dd1ec85f809036aa54c4bb80627bcd4d50525ed8..b414e2a8ac27b4c974daab30969ca104701bd02a 100644 (file)
@@ -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."""