]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Allow subclasses to modify dict_extend hooks
authorSalvatore Orlando <salv.orlando@gmail.com>
Tue, 3 Sep 2013 00:37:22 +0000 (17:37 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Tue, 3 Sep 2013 00:37:22 +0000 (17:37 -0700)
commita07bbac1c40dd4f748fe9a40f8adb3654b3ed8e3
tree18be46f2e776f7acde6641329d04692ca040a2c8
parentb63c6f9f839188ade489d77747164b0fec8ab116
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
neutron/db/db_base_plugin_v2.py
neutron/db/extradhcpopt_db.py
neutron/db/extraroute_db.py
neutron/db/l3_db.py
neutron/db/portsecurity_db.py
neutron/db/securitygroups_db.py
neutron/plugins/nicira/dbexts/distributedrouter.py
neutron/plugins/nicira/dbexts/maclearning.py