Commit Graph

18 Commits

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

  modified-iterating-list,
  implicit-str-concat,
  global-variable-not-assigned

Trivialfix

Change-Id: I7deb5f1e0aa2852cb033c78dcb4c8bc87e34be1e
2023-08-01 15:40:22 -04:00
Rodolfo Alonso Hernandez 9401da6c7c Handle if "TRUNK_SKELETON" is not loaded
If "TRUNK_SKELETON" has not been initialized, the "unregister" method
should finish gracefully. This issue is happening in fullstalk tests,
where the trunk initialization is not executed if "trunk" is not in
the service plugins.

Closes-Bug: #2000314
Change-Id: Idef5fd8feaf1af309862d6cb3e06da3734fb6c19
2022-12-13 16:36:14 +01: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
Felix Huettner 2402145713 Cleanup fanout queues on ovs agent stop (part 2)
As a followup from the previous commit we here now also cleanup the
SubPort an Trunk fanout queues.

Closes-Bug: #1586731
Change-Id: I047603b647dec7787c2471d9edb70fa4ec599a2a
2022-09-09 09:03:45 +02:00
Nurmatov Mamatisa 69ef824069 Use payloads for TRUNK and SUBPORTS callbacks
This patch switches the code over to the payload style of callbacks [1]
for TRUNK and SUBPORTS events. As needed existing callbacks are shimmed
to support both payload and kwarg style callbacks. These shims will be
removed once all callbacks are switched over to payloads.
Also the neutron.services.trunk.callback module is removed as consumers
will no longer need the TrunkPayload therein.

NeutronLibImpact

[1]
https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html

Change-Id: Ie302b48b283f8780072b5c9e2bc8787d87c11794
2021-04-30 14:41:08 +03:00
Brian Haley b79842f289 Start enforcing E125 flake8 directive
Removed E125 (continuation line does not distinguish itself
from next logical line) from the ignore list and fixed all
the indentation issues.  Didn't think it was going to be
close to 100 files when I started.

Change-Id: I0a6f5efec4b7d8d3632dd9dbb43e0ab58af9dff3
2019-07-19 23:39:41 -04:00
Boden R ff70e20acc use neutron-lib trunk resource names
The trunk callback resource names now live in neutron-lib [1].
This patch switches over to use those constants from lib and they
will be removed from neutron in a later patch once consumers switch
over to lib as well.

[1] https://review.openstack.org/#/c/635209/

Change-Id: I79dfe76c1b698fe634393e469157014f1914cc8e
2019-03-25 09:59:13 -06:00
Jakub Libosvar 3a962e5559 trunk: Fix init_handler() agent parameter
Commit 40866acd02 stopped passing agent
object as parameter as it's already referenced by `trigger' parameter.
This leads to an error during notify_after_init() in agents' code and
hence trunk handlers are never initialized. This patch replaces `agent'
reference with `trigger' to correctly initialize handlers.

Change-Id: I808980553056b9fec4e2700c1d5440e42091afbf
Closes-bug: #1722967
2017-10-17 08:22:10 +00:00
Inessa Vasilevskaya 7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
ZhaoBo 012de2ea08 Correct the config group in check_trunk_dependencies
The 'securitygroup' is registered as cfg.CONF.SECURITYGROUP. Currently,
this check always raise error as no 'cfg.CONF.securitygroup', then neutron
will abort the trunk_create. So nova will error when create VM with trunk
parent port for waiting timeout about the network-vif-plugged event.

Closes-Bug: #1699516
Related-Bug: #1669074
Change-Id: I0b0bdb5a39f1978e12ddaeddd4e0d825894ea241
2017-06-21 22:07:44 +00:00
Armando Migliaccio 48dbb65e8b Warn the admin of a potential OVS firewall_driver misconfiguration
OVS trunks work only with OVS firewall to implement security
groups. If a trunk request is indeed processed by an OVS agent
whose firewall_driver = iptables_hybrid, we should at least
log a warning to alert the admin.

Closes-bug: #1669074

Change-Id: I60e77e60e5e6d46ceff4bff61cbc07b6534ef152
2017-06-09 22:38:30 +00:00
Kevin Benton cf6ffb78f6 Pass context and resource_type in RPC callback
Maintaining the context is important for keeping the request ID
and subsequently operator/developer sanity while debugging.
The resource_type is also helpful to have since a function could be
subscribed for multiple resources.

This maintains and deprecates the existing 'subscribe' method for
backwards compatibility with callbacks that don't support receiving
the context and resource type. A new 'register' method is added
for callbacks to use that are compatible with receiving the context.

Change-Id: I06c8302951c99039b532acd9f2a68d5b989fdab5
2016-12-08 06:03:59 -08:00
Armando Migliaccio 4148102f73 Process OVS trunk bridges associated to VM deletes
If a VM is deleted while the OVS agent is down, upon
restart the OVS trunk bridge is deleted successfully
but the patch ports integration bridge side are left
behind.

This patch makes sure the bridge as well as its peers
are cleaned up.

Closes-bug: #1623708

Change-Id: I3f010755fdb6501753d20357ad2cd0d6c02cf22a
2016-09-26 23:11:22 +00:00
Armando Migliaccio 4371ae010a Ensure trunk status is acknowledged during OVS subport operations
Before this patch, change to trunk status was reported only when
subports were being added, but not when being removed. This patch
tweak things to make sure the same happens on subports removal.

This patch also improves unit coverage for the parts of the code
affected. In particular the import of oslo_context has been aliased
to catch errors where context as variable is shadowed by the homonym
module.

Closes-bug: #1625135

Change-Id: I73127d7829c31ca66578eb8f7d76409b36c9dc6d
2016-09-21 15:16:02 -07:00
Jakub Libosvar 9776d93f58 Catch RPC errors in trunk skeleton
Wiring actions of OVSDB handler communicate with server, while there is
no handling within the methods. This patch catches such failures of rpc
coming from those methods.

Partially-implements: blueprint vlan-aware-vms
Change-Id: I74663cccb0d16ce06fff479e7890dd7e8f5aefb4
2016-09-14 04:55:15 -04:00
Jakub Libosvar 1087be3522 trunk: Handle subports notification in ovs agent side
Patch implements RPC notifications about adding
and removing subport resources using ovsdb handler on openvswitch agent
driver side.

Change-Id: I62debd37cafdb04b8726f9f37516fa3575e5d37f
Partially-implements: blueprint vlan-aware-vms
2016-09-09 06:43:16 -04:00
rossella 52300f285a OVSDBHandler for trunk ports
Handler processes the events passed by OVSDBMonitor
and reacts to events related to trunk ports, calling
to trunk manager to wire/unwire trunks and subports.

Co-Authored-By: Jakub Libosvar <libosvar@redhat.com>
Partially-implements: blueprint vlan-aware-vms
Change-Id: I97487e9d7647b4110a2cdd48d0f129340d59a40d
2016-09-08 22:29:37 +00:00
Armando Migliaccio e354599134 Add agent-side driver scaffolding for trunk functionality
The agent code is enhanced to allow the trunk agent-side counterpart
to be activated seamlessly by means or local registry notifications.
Some integration with the server side is provided by loading the
RPC agent-side skeleton. Basic unit testing provides some coverage.

More effective functional and system coverage will be provided once
everything comes together.

Partially-implements: blueprint vlan-aware-vms

Co-Authored-By: Adolfo Duarte <adolfo.duarte@hpe.com>
Change-Id: Id70553e8980593f99548a4d2b0a78355933f7c2c
2016-08-18 12:10:22 +00:00