Disassociate floating IP from instance with an interface with no IP fails

Bug #1520729 reported by Don Bowman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned

Bug Description

If you have an instance with 2 interfaces, and one of them has no IP (e.g. is L2 only), then
list_target_id_by_instance() fails when you disassociate a floating-ip from the first interface.

This patch resolves.

index 1478a6f..a026b15 100644
--- a/openstack_dashboard/api/neutron.py
+++ b/openstack_dashboard/api/neutron.py
@@ -506,8 +506,11 @@ class FloatingIpManager(network_base.FloatingIpManager):
                     if target['instance_id'] == instance_id]
         else:
             ports = self._target_ports_by_instance(instance_id)
- return ['{0}_{1}'.format(p.id, p.fixed_ips[0]['ip_address'])
- for p in ports]
+ v = []
+ for p in ports:
+ if len(p['fixed_ips']):
+ v.append('{0}_{1}'.format(p['id'], p['fixed_ips'][0]['ip_address']))
+ return v

Revision history for this message
guiyanxing (guiyanxing) wrote :

I have reproduce it,not found the problem you said. when i associate a fip to an instance interface with no ip ,then disassociate the fip ,it;s success.

guiyanxing (guiyanxing)
Changed in horizon:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.