Browse Source

use payloads for PORT BEFORE_DELETE callbacks

This patch switches BEFORE_DELETE callback events for PORT resources
over to the payload style args use a DBEventPayload object in prep for
the depends on patch.

Change-Id: I8b4b0387f6934c3f1001d3aada5c47a784d3706a
Depends-On: https://review.openstack.org/#/c/595883/
Boden R 7 months ago
parent
commit
b7ff572f24
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      neutron_lbaas/db/loadbalancer/loadbalancer_dbv2.py

+ 5
- 6
neutron_lbaas/db/loadbalancer/loadbalancer_dbv2.py View File

@@ -1034,10 +1034,9 @@ class LoadBalancerPluginDbv2(base_db.CommonDbMixin,
1034 1034
                 for rule_db in rule_dbs]
1035 1035
 
1036 1036
 
1037
-def _prevent_lbaasv2_port_delete_callback(resource, event, trigger, **kwargs):
1038
-    context = kwargs['context']
1039
-    port_id = kwargs['port_id']
1040
-    port_check = kwargs['port_check']
1037
+def _prevent_lbaasv2_port_delete_callback(resource, event,
1038
+                                          trigger, payload=None):
1041 1039
     lbaasv2plugin = directory.get_plugin(pg_const.LOADBALANCERV2)
1042
-    if lbaasv2plugin and port_check:
1043
-        lbaasv2plugin.db.prevent_lbaasv2_port_deletion(context, port_id)
1040
+    if lbaasv2plugin and payload.metadata['port_check']:
1041
+        lbaasv2plugin.db.prevent_lbaasv2_port_deletion(
1042
+            payload.context, payload.resource_id)

Loading…
Cancel
Save