ML2 bigswitch driver modifies PortContext.current

Bug #1294308 reported by Robert Kukura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

The ML2 bigswitch mechanism driver's create_port_postcommit() and update_port_postcommit() methods pass the PortContext to a _prepare_port_for_controller() method that modifies the port dictionary accessed as PortContext.current. This modified port dictionary is currently returned by ML2 as the result of the port create or update operation, but the changes do not get persisted in the DB. The fix for bug 1276391 is likely to result in these changes no longer being returned to the client. Mechanism drivers are not supposed to modify this port dictionary, except by calling PortContext.set_binding() from within bind_port(). It does not appear that this mechanism driver actually binds ports. If the port dictionary needs to be modified before being passed to the bigswitch controller, it should be copied first.

Also, the TestBigSwitchMechDriverPortsV2.test_port_vif_details() unit test asserts that the returned binding:vif_type is the modified value, so this test will also need to be changed or eliminated as part of this fix.

Tags: bigswitch ml2
Robert Kukura (rkukura)
Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
importance: Undecided → High
milestone: none → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
tags: added: bigswitch
Robert Kukura (rkukura)
tags: added: ml2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/81360
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9014f66fce619af6d72823b3fdb0ecf148582649
Submitter: Jenkins
Branch: master

commit 9014f66fce619af6d72823b3fdb0ecf148582649
Author: Kevin Benton <email address hidden>
Date: Tue Mar 18 12:11:53 2014 -0700

    ML2 BigSwitch: Don't modify parent context

    Makes a copy of the port context before changing
    it in preparation for the backend controller so
    other drivers are not affected. Also removes a
    UT that was exercising direct modification of VIF
    details in the port context, which is not allowed
    by the ML2 plugin.

    Closes-Bug: #1294308
    Change-Id: I47281dcd23c022813b8b6eda0a3d39c4482277b9

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
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.