Merge "use payloads for SUBNET BEFORE_DELETE events"

This commit is contained in:
Zuul 2018-11-05 13:45:44 +00:00 committed by Gerrit Code Review
commit ecab028a66

View File

@ -727,10 +727,10 @@ def migration_callback(resource, event, trigger, **kwargs):
return True return True
def subnet_callback(resource, event, trigger, **kwargs): def subnet_callback(resource, event, trigger, payload=None):
"""Respond to subnet based notifications - see if subnet in use.""" """Respond to subnet based notifications - see if subnet in use."""
context = kwargs['context'] context = payload.context
subnet_id = kwargs['subnet_id'] subnet_id = payload.resource_id
vpn_plugin = directory.get_plugin(p_constants.VPN) vpn_plugin = directory.get_plugin(p_constants.VPN)
if vpn_plugin: if vpn_plugin:
vpn_plugin.check_subnet_in_use_by_endpoint_group(context, subnet_id) vpn_plugin.check_subnet_in_use_by_endpoint_group(context, subnet_id)