Nested loop breaking out doesn't handle correctly

Bug #1659169 reported by Zhenguo Niu on 2017-01-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Zhenguo Niu

Bug Description

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

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.

Changed in nova:
assignee: nobody → Zhenguo Niu (niu-zglinux)
status: New → In Progress
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → New
assignee: Zhenguo Niu (niu-zglinux) → nobody
Sean Dague (sdague) wrote :

This only would be an issue with extremely large numbers of ports, marking as Opinion.

Changed in nova:
status: New → Opinion
importance: Undecided → Wishlist
Sean Dague (sdague) wrote :

Found open reviews for this bug in gerrit, setting to In Progress.

review: in branch: master

Changed in nova:
status: Opinion → In Progress
assignee: nobody → Zhenguo Niu (niu-zglinux)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers