Merge "Don't use save_and_reraise_exception when we never reraise"
This commit is contained in:
commit
a520fc6156
neutron/db
@ -23,7 +23,6 @@ from neutron_lib import constants
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
from sqlalchemy import orm
|
||||
@ -437,11 +436,10 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
|
||||
resources.ROUTER_GATEWAY, events.BEFORE_DELETE, self,
|
||||
**kwargs)
|
||||
except exceptions.CallbackFailure as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router.id, reason=e)
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router.id, reason=e)
|
||||
|
||||
def _create_gw_port(self, context, router_id, router, new_network_id,
|
||||
ext_ips):
|
||||
@ -890,11 +888,10 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
|
||||
resources.ROUTER_INTERFACE,
|
||||
events.BEFORE_DELETE, self, **kwargs)
|
||||
except exceptions.CallbackFailure as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router_id, reason=e)
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router_id, reason=e)
|
||||
for fip_db in fip_qry.filter_by(router_id=router_id):
|
||||
if netaddr.IPAddress(fip_db['fixed_ip_address']) in subnet_cidr:
|
||||
raise l3.RouterInterfaceInUseByFloatingIP(
|
||||
|
@ -115,12 +115,10 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
|
||||
registry.notify(
|
||||
resources.ROUTER, events.BEFORE_UPDATE, self, **kwargs)
|
||||
except exceptions.CallbackFailure as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router_db['id'],
|
||||
reason=e)
|
||||
# NOTE(armax): preserve old check's behavior
|
||||
if len(e.errors) == 1:
|
||||
raise e.errors[0].error
|
||||
raise l3.RouterInUse(router_id=router_db['id'], reason=e)
|
||||
return True
|
||||
|
||||
def _handle_distributed_migration(self, resource, event, trigger, context,
|
||||
|
Loading…
x
Reference in New Issue
Block a user