use callback payloads for ROUTER/ROUTER_GATEWAY BEFORE_DELETE events

This patch switches ROUTER/ROUTER_GATEWAY BEFORE_DELETE events to use
payload style args. For more details see the depends on patch.

Depends-On: I3ce4475643f4f0afed01f2e9956b3bf84714e6f2
Change-Id: I8a396cb2112c59dd371bc41738939cd109abb8bc
This commit is contained in:
Boden R 2018-06-22 12:45:33 -06:00 committed by Kobi Samoray
parent 7c716ed020
commit e8e72a9e19

View File

@ -131,11 +131,11 @@ class EdgeLoadbalancerDriverV2(base_mgr.LoadbalancerBaseManager):
context, filters=filters)
def _check_lb_service_on_router(self, resource, event, trigger,
**kwargs):
payload=None):
"""Prevent removing a router GW or deleting a router used by LB"""
router_id = kwargs.get('router_id')
context = kwargs['context']
nsx_router_id = nsx_db.get_nsx_router_id(kwargs['context'].session,
router_id = payload.resource_id
context = payload.context
nsx_router_id = nsx_db.get_nsx_router_id(context.session,
router_id)
if not nsx_router_id:
# Skip non-v3 routers (could be a V router in case of TVD plugin)