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 <libosvar@redhat.com>
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
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
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
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e
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
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.
NeutronLibImpact
Change-Id: Ia4a4604c259ce862597de80c6deeb3d408bf0e95
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
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.
NeutronLibImpact
Change-Id: I767c626f3fe6159ab3abd6a7ae3cb9893b79bf66
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
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
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
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
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
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
* 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
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
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.
DocImpact
New ML2 mech driver + l2 agent
New config option "macvtap.physical_interface_mappings"
Change-Id: I219d80b4c704ac2f41edd3501f4b2198925778d6
Closes-Bug: #1480979