Merge "use payloads for NETWORK BEFORE_DELETE events"

This commit is contained in:
Zuul 2018-10-22 12:41:57 +00:00 committed by Gerrit Code Review
commit cf4992cab7
2 changed files with 5 additions and 4 deletions

View File

@ -461,8 +461,9 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
@lib_db_api.retry_if_session_inactive()
def delete_network(self, context, id):
registry.notify(resources.NETWORK, events.BEFORE_DELETE, self,
context=context, network_id=id)
registry.publish(resources.NETWORK, events.BEFORE_DELETE, self,
payload=events.DBEventPayload(
context, resource_id=id))
self._ensure_network_not_in_use(context, id)
with db_api.context_manager.reader.using(context):
auto_delete_port_ids = [p.id for p in context.session.query(

View File

@ -243,5 +243,5 @@ class External_net_db_mixin(object):
@registry.receives(resources.NETWORK, [events.BEFORE_DELETE])
def _before_network_delete_handler(self, resource, event, trigger,
context, network_id, **kwargs):
self._process_l3_delete(context, network_id)
payload=None):
self._process_l3_delete(payload.context, payload.resource_id)