← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1659169] [NEW] Nested loop breaking out doesn't handle correctly

 

Public bug reported:

https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1674-L1681

for p in ports:
    for ip in p['fixed_ips']:
        if ip['ip_address'] == address:
            port_id = p['id']
            break

in the above nested loops, when we find the port_id, it just break one
for loop, the outside loop will continue, it's a bit waste, should
handle this gracefully.

** Affects: nova
     Importance: Undecided
     Assignee: Zhenguo Niu (niu-zglinux)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1659169

Title:
  Nested loop breaking out doesn't handle correctly

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1674-L1681

  for p in ports:
      for ip in p['fixed_ips']:
          if ip['ip_address'] == address:
              port_id = p['id']
              break

  in the above nested loops, when we find the port_id, it just break one
  for loop, the outside loop will continue, it's a bit waste, should
  handle this gracefully.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1659169/+subscriptions


Follow ups