get_port(s) iterate once more due to adding binding info

Bug #1195047 reported by yong sheng gong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
yong sheng gong

Bug Description

many plugins still add binding information by iterating once more:
    def get_port(self, context, port_id, fields=None):
        with context.session.begin(subtransactions=True):
            port = super(BrocadePluginV2, self).get_port(
                context, port_id, fields)
            self._extend_port_dict_binding(context, port)

        return self._fields(port, fields)

    def get_ports(self, context, filters=None, fields=None):
        res_ports = []
        with context.session.begin(subtransactions=True):
            ports = super(BrocadePluginV2, self).get_ports(context,
                                                           filters,
                                                           fields)
            for port in ports:
                self._extend_port_dict_binding(context, port)
                res_ports.append(self._fields(port, fields))

        return res_ports

Tags: brocade
Changed in quantum:
assignee: nobody → yong sheng gong (gongysh)
importance: Undecided → Medium
milestone: none → havana-2
Changed in quantum:
status: New → In Progress
Changed in neutron:
milestone: havana-2 → none
tags: added: brocade
Changed in neutron:
importance: Medium → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/34133
Committed: http://github.com/openstack/neutron/commit/76fc0addc985195dc6fddd78c9030cc5d24cfe88
Submitter: Jenkins
Branch: master

commit 76fc0addc985195dc6fddd78c9030cc5d24cfe88
Author: Yong Sheng Gong <email address hidden>
Date: Tue Jul 23 13:21:24 2013 +0800

    refactor port binding codes

    Bug #1195047

    This patch:
    1. removes the iteration in get_ports to call extend_dict_binding
    2. uses a unified way for plugins to do this kind of stuff

    ml2 will enhance the binding so that it can have different binding
    for port according to port's host.
    mlnx and bigswitch are also exceptions due to the dynamic binding info.

    Change-Id: I5a77eb7395e14482a856e033f536f72a1bf82e06

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → havana-3
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-3 → 2013.2
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.