Commit Graph

22 Commits (master)

Author SHA1 Message Date
Jakub Libosvar 4d3a274765 Don't register config options on imports
Importing some modules lead to registering config options that may
collide with config options from a project that calls the import. This
patch wraps the side effect that registers config options into a
function that needs to be called in case the caller wants to register
the options.

This solution is also not perfect as it guards the common options to be
registered only once even if the function is called multiple times. This
is to solve problems in unittests, ideally we should always call the
function just once even in our testing suites.

Resolves-Bug: #1968606
Change-Id: Ic1532eb8de887ff1b1085206df11f53e22f7f524
Signed-off-by: Jakub Libosvar <>
2022-04-13 05:49:15 +00:00
Zuul cee4686710 Merge "Set process name for agents" 2020-07-08 13:40:10 +00:00
Bernard Cafarelli 5ce0595803
Set process name for agents
Now that we use setproctitle for neutron-server workers (and
neutron-keepalived-state-change), this has the side effect of changing
the process name for agents, impacting some monitoring systems. More
details in launchpad bug.

This patch fixes it by setting the name with setproctitle to:
agent name (original process name).

Also use the newly introduced name constants to replace existing
hardcoded uses.

Change-Id: I74c3a4d3e9f833752571a75f196560cd45529385
Closes-Bug: #1881297
2020-07-01 12:28:29 +02:00
Minmin Ren 4c04e60d45 Config privsep in the macvtap agent
The commands executed under a privsep context,
privsep should be initialized first.

Change-Id: I82d67847c71d276184026e5af5787235228035c0
2020-06-30 21:49:18 +08:00
Brian Haley a58a527494 Scan for MAC through all devices in macvtap agent
The first device the agent happens to pick could be something
without a MAC address like a 6in6 interface. This was causing
the agent to fail to start if it was unlucky enough to pick
that address.

This patch just adjusts the logic to keep iterating through
the list until we find a MAC.

Change-Id: Iba9c7c3cb200e74a78ea885e8d9323de64c2c663
Closes-Bug: #1801030
2018-11-01 16:00:16 -04:00
Sławek Kapłoński b6b23a8f77 Enable mutable config in Neutron
New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Neutron delegates making this
call to oslo.service. This was provided in patchset

Further patches will be needed to make select config options be
marked as mutable. This change enables support for oslo provided
config options to be updated via SIGHUP such as log level.

Task: 6389
Story: 2001545

Change-Id: I9442965607f3248706464643c6d87a04edcae24e
2018-03-21 20:35:19 +00:00
Boden R ef93f7e7f0 use common agent topics from neutron-lib
The neutron.common.topics module was rehomed into neutron-lib with
commit Ie88b84949cbd55a4e7ad06341aab77b286cdc485
This patch consumes it by removing the rehomed module from neutron
and using the module from neutron-lib instead.


Change-Id: Ia4a4604c259ce862597de80c6deeb3d408bf0e95
2018-03-13 11:35:50 -06:00
Sławek Kapłoński cbee0f9f88 Use same instance of iptables_manager in L2 agent and extensions
This commit adds common_agent_extension class which is agent API
for L2 extension drivers used e.g. by Linuxbridge agent.
This is necessary to be able to use instance of iptables_manager
used in firewall driver also in L2 extension drivers (like qos).

This patch refactors little bit iptables_manager code to make possible
to initialize e.g. mangle or nat table on demand, even if iptables
is created as "state_less"

Change-Id: I3b66e49b7f176124e8aea3eb96d0d465f1ab1ea0
Closes-Bug: #1736674
2018-01-05 11:07:32 +01:00
Boden R 95f1e03446 use plugin constants from neutron-lib
neutron-lib contains a number of the plugin related constants from
neutron.plugins.common.constants. This patch consumes those constants
from neutron-lib and removes them from neutron. In addition the notion
of the dummy plugin service type is moved strictly into the test
package of neutron since it's not a real service plugin.


Change-Id: I767c626f3fe6159ab3abd6a7ae3cb9893b79bf66
2017-10-16 09:32:20 -06: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
Jenkins f8e942c5bd Merge "Terminate macvtap agent when physical_interface_mapping config not present" 2017-02-06 11:17:03 +00:00
Andreas Scheuring 557e0c0a4c Terminate macvtap agent when physical_interface_mapping config not present
Starting the macvtap agent without specifying at least one
physical_interface_mappings does not make sense. As it only
supports layer2 networks (flat, vlan) an interface mapping is
mandatory. An existing agent deployment without an interface
mapping can not serve any networks to instances!

This patch terminates the agent when no mapping is
provided. As without this mapping the agent cannot serve any networks
for instances, this patch can't really break existing deployments.

UpgradeImpact Agent terminates when no physical_interface_mapping
configuration is provided.

Change-Id: I647cf4da55fda54e32b7047b84e0d7f671629fa7
Closes-Bug: #1587444
2017-02-01 07:08:20 +00:00
Anindita Das 5e1c3c705e Refactoring config options for plugin macvtap opts
Refactoring neutron ml2 plugin macvtap driver config opts to be in
neutron/conf/plugins/ml2/drivers/macvtap so that all the
configuration options for macvtap drivers reside in a centralized
location. This simplifies the process of looking up the macvtap driver
config opts and provides an easy way to import.

Change-Id: I1768eefb9eadcea19bcb675cbd96a6cb728b4123
Partial-Bug: #1563069
2016-11-21 19:46:00 +00:00
Dariusz Smigiel 9733825896 Cleanup of SecurityGroup classes
Commit Ifb70a118cef48c3c4cd313e22e907aa47bc51ad0 intended to remove some
classes, but without DeprecationWarnings. To prevent from possible
problems, if it would be now removed, added Warnings and included info,
about future removal.

Change-Id: Iacb93abc363bf638efc3acb5b29c02a7508bc43a
Related-Bug: #1444112
2016-10-13 15:38:38 +00:00
Jenkins 09f326a6dd Merge "neutron-lib: start using neutron-lib helpers" 2016-10-12 19:01:47 +00:00
Gary Kotton 396abb8ccb neutron-lib: start using neutron-lib helpers
The following helpers are used:

Change-Id: I5947b473330fd29f8d4c1a08f03d007a52c8dfd9
2016-10-10 01:30:26 -07:00
Brian Haley 0963aec572 Refactor code to deprecate get_interface_mac
The ip_lib code is able to get the MAC address of a device
already using the IpLinkCommand class, let's remove
get_interface_mac() since it's not necessary.

Changed all callers to use the new get_device_mac() code
and tagged get_interface_mac() for deprecation since it
could be in use by other callers outside the neutron tree.

Closes-Bug: #1630439

Change-Id: I1695d7e46efe5245eb581bd40d5420250a3bad89
2016-10-07 12:57:09 -04:00
Andreas Scheuring 96d1d914ca Macvtap: Allow noop alias as FW driver
The macvtap agent only works with the NoopFWDriver. If another
driver is configured it terminates. Today only the explicit
configuration "neutron.agent.firewall.NoopFirewallDriver" is
accepted. This patch enables the macvtap agent to also accept
the alias "noop"

Change-Id: I0d6f0b780a3881419243f12487e8b3d10e709f6c
Closes-Bug: #1587498
2016-05-31 16:37:04 +02:00
Henry Gessau 4148a347b3 Use constants from neutron-lib
With this we enable the deprecation warnings by default.

Related-Blueprint: neutron-lib

Change-Id: I5b9e53751dd164010e5bbeb15f534ac0fe2a5105
2016-04-23 21:23:56 -04:00
Akihiro Motoki 44be13a2a6 Hacking rule to check i18n usage
* Detect neutron.i18n import (neutron._i18n is recommended)
* Check builtins _ usage
* 'builtins = _' in tox.ini is no longer required.
* Introduce hacking rule doctest framework.
  Newly added check_builtins_gettext() hacking check takes
  token as argument. It is not a good idea to pass a tokenized
  line manually. Instead it is reasonable to use docstring based
  tests used in hacking repo.

Change-Id: Ib7464658fc4c8a6f1b03af6ab46f0bd3ee0bfb18
2016-03-30 21:28:37 -04:00
Kevin Benton 7afbd3a6b8 Check tap bridge timestamps to detect local changes
During a quick instance rebuild on Nova, it may remove a tap
interface and then plug it in within the agent polling window.
In this scenario the agent will not realize a device has changed
and will therefore not ask the server for info an subsequently
update its status. This will prevent the notification from being
sent back to Nova that the vif plugging has finished so the
VM will never resume state.

This adds a new timestamp collection method to the common agent
manager interface for devices that is used by the common agent
loop to determine if a device has locally changed.

The linux bridge implementation of it checks the timestamps on the
tap interface's 'bridge' directory, which will change whenever
the tap is added to bridge.

Closes-Bug: #1531862
Change-Id: If172470e907848556b6a8aff13520f94245919bb
2016-03-10 03:04:11 -08:00
Andreas Scheuring 2e7eb09271 macvtap: Macvtap L2 Agent
This agent is required by the macvtap ml2 driver to support
macvtap attachments for libvirt qemu/kvm instances. It introduces
a new configuration option MACVTAP.physical_interface_mappings.

The review is submitted in three parts:
 - Part 1
    Common functions that are used by the ml2 driver and the agent
 - Part 2
     The Mechanism Driver to support port binding for macvtap attachments
 - Part 3 (this part)
    The Macvtap L2 Agent.

New ML2 mech driver + l2 agent
New config option "macvtap.physical_interface_mappings"

Change-Id: I219d80b4c704ac2f41edd3501f4b2198925778d6
Closes-Bug: #1480979
2016-02-26 15:48:01 +00:00