neutronv2 API: remove_fixed_ip_from_instance constructs a client for each port in the loop

Bug #1430481 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

We already get a neutronclient object once at the beginning of this method when we're getting the list of ports, we don't need to get it again every time we're in the loop for the ports to update them:

http://git.openstack.org/cgit/openstack/nova/tree/nova/network/neutronv2/api.py#n803

Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/163181

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/163181
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7560620da7704671e6e5a304c25e506e12f213bd
Submitter: Jenkins
Branch: master

commit 7560620da7704671e6e5a304c25e506e12f213bd
Author: Matt Riedemann <email address hidden>
Date: Tue Mar 10 13:54:52 2015 -0700

    neutronv2: only create client once when adding/removing fixed IPs

    We don't need to create a neutron client object (session) every time we
    need to make an API call in add_fixed_ip_to_instance or
    remove_fixed_ip_from_instance, especially when looping over ports and
    subnets.

    Just create the client once at the beginning of the method and reuse it.

    Closes-Bug: #1430481

    Change-Id: If9181c2ef5fb94652d0205d6d69521bcc5d85cff

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-rc1 → 2015.1.0
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.