Fix router delete w/SNAT in non-admin projects
Deleting a router or just clearing the gateway in a non-admin project fails when the external network has SNAT subnets. This patch fixes that issue. Change-Id: Ic75b2acc975ab9ba529d539a0abad189430ed737 Closes-Bug: 1709615
This commit is contained in:
parent
0d2885bf64
commit
96c8f006cd
@ -2201,6 +2201,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver,
|
||||
|
||||
def _delete_snat_ip_ports_if_reqd(self, plugin_context,
|
||||
ext_network_id, exclude_router_id):
|
||||
e_context = plugin_context.elevated()
|
||||
session = plugin_context.session
|
||||
# if there are no routers uplinked to the external network,
|
||||
# then delete any ports allocated for SNAT IP
|
||||
@ -2217,7 +2218,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver,
|
||||
.all())
|
||||
for p in snat_ports:
|
||||
try:
|
||||
self.plugin.delete_port(plugin_context, p[0])
|
||||
self.plugin.delete_port(e_context, p[0])
|
||||
except n_exceptions.NeutronException as ne:
|
||||
LOG.warning(_LW('Failed to delete SNAT port %(port)s: '
|
||||
'%(ex)s'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user