flaws in neutronv2's _get_port_id_by_fixed_address method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Low
|
Mike Chen |
Bug Description
Problem description:
When doing associcate-
https:/
def _get_port_
"""Return port_id from a fixed address."""
zone = 'compute:%s' % instance.
search_opts = {'device_id': instance.uuid,
data = client.
ports = data['ports']
port_id = None
for p in ports:
for ip in p['fixed_ips']:
if ip['ip_address'] == address:
if not port_id:
raise exception.
return port_id
to get the port id from the fixed ip the floating ip is to be associated with.
This method will return the last matched port that has the provided fixed ip, only neglecting
the fact that multiple ports can satisfy the condition.
That is, we can
1. create an instance on subnetA with allocated fixed ip 10.0.0.2/24 (portA)
2. create a portB on subnetB with fixed ip 10.0.0.2/24
3. associate portB to the instance
then the instance has portA and portB with the same address 10.0.0.2/24 on it.
Desired outcome:
The method _get_port_
it in some way.
Changed in nova: | |
assignee: | nobody → Chen (chenn2) |
tags: | added: neutron |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |