yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #41947
[Bug 1520729] [NEW] Disassociate floating IP from instance with an interface with no IP fails
Public bug reported:
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
** Affects: horizon
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1520729
Title:
Disassociate floating IP from instance with an interface with no IP
fails
Status in OpenStack Dashboard (Horizon):
New
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
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1520729/+subscriptions
Follow ups