Browse Source

Fix fip address display for loadbalancer

Currently add_floating_ip_info find floating ip based on match of
floating ip fixed address and VIP ip address which is not correct
for all cases. We may have several private subnets with same ip
range accross the tenant and occasionally loadbalancers may have
the  same VIP ip address, though ports are different.

Fix this case by comparison of ids instead of addresses.

Change-Id: Ie6ac381bb63149248fcb2f710348f97b6f68bec1
changes/53/691853/1
Ann Taraday 2 years ago
parent
commit
fe4df4319b
  1. 2
      octavia_dashboard/api/rest/lbaasv2.py

2
octavia_dashboard/api/rest/lbaasv2.py

@ -662,7 +662,7 @@ def add_floating_ip_info(request, loadbalancers):
for lb in loadbalancers:
floating_ip = {}
associated_ip = next((fip for fip in floating_ips
if fip['fixed_ip'] == lb['vip_address']), None)
if fip['port_id'] == lb['vip_port_id']), None)
if associated_ip is not None:
floating_ip['id'] = associated_ip['id']
floating_ip['ip'] = associated_ip['ip']

Loading…
Cancel
Save