Browse Source

Merge "use payloads for PORT BEFORE_DELETE callbacks"

Zuul 2 months ago
parent
commit
187f7fa85b
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

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

Loading…
Cancel
Save