Commit Graph

11 Commits

Author SHA1 Message Date
Brian Haley 929b383743 Fix some new pylint "R" warnings
After updating pylint, it started emitting additional "R"
warnings in some cases, fix some of them.

  use-a-generator,
  unnecessary-lambda-assignment,
  consider-using-max-builtin,
  consider-using-generator,
  consider-using-in,
  use-list-literal,
  consider-using-from-import

Trivialfix

Change-Id: Ife6565cefcc30b4e8a0df9121c9454cf744225df
2023-07-18 18:06:51 -04:00
Brian Haley cca0b3a026 Fix some pylint indentation warnings
Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/services.

Trivialfix

Change-Id: Ie9779b257981bc80e69639cdaa4d7dfd0ffa5809
2022-12-01 16:21:37 +00:00
Rodolfo Alonso Hernandez 41f78c678b Delete log entries when SG or port is deleted
NOTE: this patch is an ammend of [1].

When a SG or a port is deleted, the related log entry should be
too. A log entry has the following fields:
- log.resource_id = SG ID
- log.target_id = port ID

[1] was deleting all log entries, related or not with the SG ID
deleted. This is because "get_logs_bound_sg" returned all log entries,
including those ones without any "resource_id" or "target_id".

Now this method can return only the log entries related to a port or
a SG, excluding those ones without those two parameters populated.

Closes-Bug: #1939558

[1]https://review.opendev.org/c/openstack/neutron/+/804237

Change-Id: Icb92327a06486e168ce064532d819347e6031cc1
2021-10-05 16:27:13 +00:00
Slawek Kaplonski 7f06322355 Delete SG log entries when SG is deleted
When security group is deleted, log entries configured for that SG
weren't removed and stayed in the DB as orphaned entries.
That patch fixes that by subscribe logapi service plugin to the
AFTER_DELETE security group events.

Closes-bug: #1939558
Change-Id: Ibffbbd3b529c31372715d9a064f7cb6bada8c424
2021-09-06 15:03:54 +00:00
Bernard Cafarelli 8d6c301301
Update requirements for recent pip failures
Bump astroid test requirement to 2.4.0
Older versions trigger an error on wrapt dependency:
https://github.com/PyCQA/astroid/issues/755

Bump pylint accordingly to new astroid

Fix some new PEP8 warnings appearing with new versions, and filter out
the larget I202 "Additional newline in a group of imports" one for now

Drop psutil from functional requirements, it indicated an old version
and we have it in common requirements now

Bump a series of lower-constraints and requirements to work with new pip
resolver, testing with steps outlined at:
http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019285.html
This includes eventlet 0.22.1, previous versions triggered a hard to
track error on enum34
Cap cryptography in lower-constraints to prevent discovery failure in
relevant job (other jobs have it capped via upper-constraints)

Change-Id: Ie74ea517a403e6e2a7a4e0a245dd20e5281339e8
Closes-Bug: #1907242
2020-12-09 13:17:51 +01:00
Boden R 67b1c4552e use logapi constants from neutron-lib
Consume the logapi constants from neutron-lib by removing them from
neutron and using them from neutron-lib instead.

NeutronLibImpact

Depends-On: https://review.opendev.org/#/c/660826/
Change-Id: I55edf26598d38de34038f005b05ba3d2e96972aa
2019-05-22 14:49:21 -06:00
Boden R e4aa5902f7 use context manager from neutron-lib
The neutron.db.api.context_manager already references neutron-lib's
context manager; so consumers of it are already using neutron-lib. This
patch switches neutron's references to the context_manager over to
use neutron-lib's directly rather than that in neutron.db.api.

NeutronLibImpact

Change-Id: I97120faeec73690592ed21a5ec3c6202f61e1429
2018-10-24 07:18:46 -06:00
Kim Bao Long 310bfa326f Fix incorrect log resources querying
This patch aims to fix a co-existence problem between security_group
and firewall_group log resources due to incorrect log querying from
database.

Change-Id: Ic60ad436e0fbb23cdae0e63eaeb73130ebf02089
Closes-Bug: #1787119
2018-08-29 08:12:56 +07:00
Brian Haley 90cd939047 Fix W503 pep8 warnings
Fix W503 (line break before binary operator) pep8 warnings
and no longer ignore new failures.

Trivialfix

Change-Id: I7539f3b7187f2ad40681781f74b6e05a01bac474
2018-04-17 14:22:58 +00:00
Nguyen Phuong An 7bd8b37e38 [log] ovs fw logging implementation
This patch implements ovs firewall logging driver for security group
base discussed on the spec [1] and [2]

[1] https://specs.openstack.org/openstack/neutron-specs/specs/pike/logging-API-for-security-group-rules.html
[2] https://docs.google.com/presentation/d/1fteBesETsmA7CWV6wf1i2QKa7k8EHPpRjytj8Rzeb-A/edit#slide=id.p

Change-Id: Ib8668dd25ee7c5000a6dafcc7db3dbc33ad190be
Co-Authored-By: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Co-Authored-By: Yushiro FURUKAWA <y.furukawa_2@jp.fujitsu.com>
Partially-implements: blueprint security-group-logging
Related-Bug: #1468366
2018-01-09 09:26:40 +07:00
Nguyen Phuong An a253231522 [log]: Add driver api and rpc stuff for logging
This patch adds driver api and rpc stuff for logging extension as
below:
- Provides create, update and delete log api for log drivers
- Reserves a rpc notification api for log drivers if a log driver
requires rpc.
- Reserves a rpc listener for listening callback from log drivers.
- Also provides db_api: get_logs_bound_port, get_logs_bound_sg and
  get_sg_log_info_for_port and get_sg_log_info_for_log_resources.

Change-Id: I7d50356dd1da49af6faaaa8969b6ae9041f81063
Partially-implements: blueprint security-group-logging
Related-Bug: #1468366
2017-11-29 16:21:46 +07:00