use payloads for SUBNET BEFORE_DELETE events

This patch switches over to the payload style of callbacks for the
BEFORE_DELETE events of SUBNET resources in prep for the depends on
patch listed below.

Change-Id: Ia4a3f8074d9c2e879ead97957b2f962ddd0a161f
Depends-On: https://review.openstack.org/#/c/597561/
This commit is contained in:
Boden R 2018-08-29 09:14:25 -06:00
parent 7434a1e5eb
commit 6612506950
1 changed files with 3 additions and 3 deletions

View File

@ -727,10 +727,10 @@ def migration_callback(resource, event, trigger, **kwargs):
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."""
context = kwargs['context']
subnet_id = kwargs['subnet_id']
context = payload.context
subnet_id = payload.resource_id
vpn_plugin = directory.get_plugin(p_constants.VPN)
if vpn_plugin:
vpn_plugin.check_subnet_in_use_by_endpoint_group(context, subnet_id)