From c68ce94f014549f46094e67a2fba92676522dd21 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 13 Dec 2021 13:53:47 +0000 Subject: [PATCH] [stable-only] "_clean_logs_by_target_id" to use old notifications "LoggingPlugin._clean_logs_by_resource_id" method receives PORT, AFTER_DELETE events, in the old format (not using payloads but kwargs). New implementation was added in Xena release. Closes-Bug: #1954666 Change-Id: I736fef3a10bc2887efb26c95e9fc1eea14969ccf (cherry picked from commit aaa0e99bacabe8d97f7090f42c21b3a80bf6d384) --- neutron/services/logapi/logging_plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/neutron/services/logapi/logging_plugin.py b/neutron/services/logapi/logging_plugin.py index c40862758f7..8fbb0f8d1bd 100644 --- a/neutron/services/logapi/logging_plugin.py +++ b/neutron/services/logapi/logging_plugin.py @@ -63,10 +63,11 @@ class LoggingPlugin(log_ext.LoggingPluginBase): self._clean_logs(payload.context.elevated(), sg_id=payload.resource_id) @registry.receives(resources.PORT, [events.AFTER_DELETE]) - def _clean_logs_by_target_id(self, resource, event, trigger, payload): + def _clean_logs_by_target_id(self, resource, event, trigger, **kwargs): # log.target_id == port - self._clean_logs(payload.context.elevated(), - port_id=payload.resource_id) + context = kwargs['context'] + port_id = kwargs['port']['id'] + self._clean_logs(context.elevated(), port_id=port_id) @db_base_plugin_common.filter_fields @db_base_plugin_common.convert_result_to_dict