Merge "Get rid of floating IP bgp next_hop query"

This commit is contained in:
Jenkins 2017-01-21 13:27:16 +00:00 committed by Gerrit Code Review
commit 4f705137e9
2 changed files with 2 additions and 18 deletions

View File

@ -1212,17 +1212,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
if 'description' in fip:
update['description'] = fip['description']
floatingip_db.update(update)
next_hop = None
if router_id:
# NOTE(tidwellr) use admin context here
# tenant may not own the router and that's OK on a FIP association
router = self._get_router(context.elevated(), router_id)
gw_port = router.gw_port
for fixed_ip in gw_port.fixed_ips:
addr = netaddr.IPAddress(fixed_ip.ip_address)
if addr.version == constants.IP_VERSION_4:
next_hop = fixed_ip.ip_address
break
return {'fixed_ip_address': internal_ip_address,
'fixed_port_id': port_id,
'router_id': router_id,
@ -1230,7 +1219,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
'floating_ip_address': floatingip_db.floating_ip_address,
'floating_network_id': floatingip_db.floating_network_id,
'floating_ip_id': floatingip_db.id,
'next_hop': next_hop,
'context': context}
def _is_ipv4_network(self, context, net_id):

View File

@ -2370,8 +2370,6 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
fip_id = fip['floatingip']['id']
router_id = body['floatingip']['router_id']
body = self._show('routers', router_id)
ext_gw_info = body['router']['external_gateway_info']
ext_fixed_ip = ext_gw_info['external_fixed_ips'][0]
notify.assert_any_call(resources.FLOATING_IP,
events.AFTER_UPDATE,
mock.ANY,
@ -2382,8 +2380,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
floating_network_id=fip_network_id,
last_known_router_id=None,
floating_ip_id=fip_id,
router_id=router_id,
next_hop=ext_fixed_ip['ip_address'])
router_id=router_id)
def test_floatingip_disassociate_notification(self):
with self.port() as p:
@ -2412,8 +2409,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
floating_network_id=fip_network_id,
last_known_router_id=router_id,
floating_ip_id=fip_id,
router_id=None,
next_hop=None)
router_id=None)
def test_floatingip_association_on_unowned_router(self):
# create a router owned by one tenant and associate the FIP with a