Browse Source

[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 aaa0e99bac)
changes/64/821564/1
Rodolfo Alonso Hernandez 5 months ago
parent
commit
c68ce94f01
  1. 7
      neutron/services/logapi/logging_plugin.py

7
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

Loading…
Cancel
Save