Merge "Remove duplicated check for router connect to external net"
This commit is contained in:
commit
7c8c169578
@ -654,8 +654,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase):
|
|||||||
When a floating IP is associated with an internal port,
|
When a floating IP is associated with an internal port,
|
||||||
we need to extract/determine some data associated with the
|
we need to extract/determine some data associated with the
|
||||||
internal port, including the internal_ip_address, and router_id.
|
internal port, including the internal_ip_address, and router_id.
|
||||||
We also need to confirm that this internal port is owned by the
|
The confirmation of the internal port whether owned by the tenant who
|
||||||
tenant who owns the floating IP.
|
owns the floating IP will be confirmed by _get_router_for_floatingip.
|
||||||
"""
|
"""
|
||||||
(internal_port, internal_subnet_id,
|
(internal_port, internal_subnet_id,
|
||||||
internal_ip_address) = self._internal_fip_assoc_data(context, fip)
|
internal_ip_address) = self._internal_fip_assoc_data(context, fip)
|
||||||
@ -663,18 +663,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase):
|
|||||||
internal_port,
|
internal_port,
|
||||||
internal_subnet_id,
|
internal_subnet_id,
|
||||||
floating_network_id)
|
floating_network_id)
|
||||||
# confirm that this router has a floating
|
|
||||||
# ip enabled gateway with support for this floating IP network
|
|
||||||
try:
|
|
||||||
port_qry = context.elevated().session.query(models_v2.Port)
|
|
||||||
port_qry.filter_by(
|
|
||||||
network_id=floating_network_id,
|
|
||||||
device_id=router_id,
|
|
||||||
device_owner=DEVICE_OWNER_ROUTER_GW).one()
|
|
||||||
except exc.NoResultFound:
|
|
||||||
raise l3.ExternalGatewayForFloatingIPNotFound(
|
|
||||||
subnet_id=internal_subnet_id,
|
|
||||||
port_id=internal_port['id'])
|
|
||||||
|
|
||||||
return (fip['port_id'], internal_ip_address, router_id)
|
return (fip['port_id'], internal_ip_address, router_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user