ML2 type and mech managers should use instance vars for drivers lists

Bug #1220296 reported by Dane LeBlanc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Dane LeBlanc

Bug Description

The Neutron ML2 plugin's type and mechanism managers currently maintain dictionaries/lists of type drivers, mechanism drivers, and ordered mechanism drivers in (static) class variables. Once a type/mechanism/ordered-mechanism driver of any given type is added to this list, then no new drivers of that type are allowed to be registered, and therefore no new configuration for that driver type is accepted.

This static nature of the driver dictionaries/lists is causing ML2 mechanism driver unit test cases to fail. For example, if a non-vendor-specific ML2 plugin test case configures a VLAN type driver with no VLAN range, and then a vendor specific test case attempts to configure a VLAN type driver with some test VLAN range, then the new VLAN configuration is ignored because of the previously (staticly) registered VLAN driver.

The proposed fix is to convert these driver dictionaries/lists to instance variables, and clear them upon each instantiation of an ML2 type manager or ML2 mechanism manager.

Dane LeBlanc (leblancd)
Changed in neutron:
assignee: nobody → Dane LeBlanc (leblancd)
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/44921

Changed in neutron:
status: New → In Progress
Changed in neutron:
assignee: Dane LeBlanc (leblancd) → Kyle Mestery (mestery)
Changed in neutron:
assignee: Kyle Mestery (mestery) → Dane LeBlanc (leblancd)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/44921
Committed: http://github.com/openstack/neutron/commit/cd17893dbce60028f0d946f9d30c3c2afea0f2e3
Submitter: Jenkins
Branch: master

commit cd17893dbce60028f0d946f9d30c3c2afea0f2e3
Author: Dane LeBlanc <email address hidden>
Date: Tue Sep 3 13:34:42 2013 -0400

    ML2 type and mech managers should use instance vars for drivers lists

    Fixes bug 1220296

    The ML2 plugin's type and mechanism managers currently maintain
    dictionaries/lists of type drivers, mechanism drivers, and ordered mechanism
    drivers in (static) class variables. Once a type/mechanism/ordered-mechanism
    driver of any given type is added to this list, then no new drivers of that
    type are allowed to be registered, and therefore no new configuration for
    that driver type is accepted.

    This static nature of the driver dictionaries/lists is causing ML2 mechanism
    driver unit test cases to fail. For example, if a non-vendor-specific ML2
    plugin test case configures a VLAN type driver with no VLAN range, and then
    a vendor specific test case attempts to configure a VLAN type driver with
    some test VLAN range, then the new VLAN configuration is ignored because of
    the previously (staticly) registered VLAN driver.

    The proposed fix is to convert these driver dictionaries/lists to instance
    variables, and clear them upon each instantiation of an ML2 type manager
    or ML2 mechanism manager.

    Change-Id: I3b5209640de229899561e2a3ec7c6dafe9a05e64

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
importance: Undecided → Medium
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.