fixes bug:
1226169
port binding feature of ML2 plugin registers a callback function with
db_base_plugin_v2.NeutronDbPluginV2, which is invoked during a query of
port DB. This function is registered by name instead by refefence. This
causes wrong context to be passed to the function upon invocation, which
causes the exception. If this query is made during neutron
initilization, Neutron service will fail to start.
This fix changes the registration from function name to function
pointer
Change-Id: I44f7f1a222f80c9ce35f7d49610e52170f76dfd1
self.mechanism_manager.unbind_port(mech_context)
self._update_port_dict_binding(port, binding)
- def _extend_port_dict_binding(self, port_res, port_db):
+ def _ml2_extend_port_dict_binding(self, port_res, port_db):
# None when called during unit tests for other plugins.
if port_db.port_binding:
self._update_port_dict_binding(port_res, port_db.port_binding)
db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs(
- attributes.PORTS, [_extend_port_dict_binding])
+ attributes.PORTS, ['_ml2_extend_port_dict_binding'])
# Note - The following hook methods have "ml2" in their names so
# that they are not called twice during unit tests due to global