extend_dict hooks cannot be overriden by subclasses

Bug #1219991 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Salvatore Orlando

Bug Description

The extend_dict hooks are registered as unbound methods which means that any subclass of a mixin will cause an unintended registration of the parent class hooks - calling the extend_xxx_dict method to be invoked even if the actual plugin class does not define one.

This is pretty much the same thing as bug 1210387 - applies to extend_dict functions rather than model hooks.

Tags: neutron-core
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/44778

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

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

commit a07bbac1c40dd4f748fe9a40f8adb3654b3ed8e3
Author: Salvatore Orlando <email address hidden>
Date: Mon Sep 2 17:37:22 2013 -0700

    Allow subclasses to modify dict_extend hooks

    Partial-Bug 1219991

    This change modifies the hook processing for dict_extend routines
    to call the method on the instance if a hook is registered as a string.
    Otherwise, the callable hook is directly invoked as an unbound method.

    This patch fixes hook registration for all extensions except port_binding.
    This is because some plugins are currently working around this limitation
    by invoking both the global hook and another dict_extend function,
    which might either be registered as another hook, or invoked explicitly
    before returning the response.
    Fixing this would go beyong the scope of this patch.

    Change-Id: Ibe78433e6554aa7fdf5156fc75b8339254876e78

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

put partial-bug by mistake in commit msg.

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: 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.