From 66125069501d34cf2a35ab76fa6e0333b5a75cf4 Mon Sep 17 00:00:00 2001 From: Boden R Date: Wed, 29 Aug 2018 09:14:25 -0600 Subject: [PATCH] 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/ --- neutron_vpnaas/db/vpn/vpn_db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron_vpnaas/db/vpn/vpn_db.py b/neutron_vpnaas/db/vpn/vpn_db.py index 4cdc6edb9..283ebef11 100644 --- a/neutron_vpnaas/db/vpn/vpn_db.py +++ b/neutron_vpnaas/db/vpn/vpn_db.py @@ -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)