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>
Check if network device exists is now done by checking
interface index with pyroute2 interface instead of checking
if MAC address for device is set.
Change-Id: I2d5b95ec109fb19fc2a46c1017959f74011b9a22
Related-Bug: #1492714
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
- This does NOT break other projects that rely on neutron.i18n,
as this change includes a debtcollector shim to maintain those
older entry points, until they can migrate.
- Also updates _i18n.py to the latest pattern defined by oslo_i18n
- Guidance and template are from the reference:
http://docs.openstack.org/developer/oslo.i18n/usage.html
Partially-Closes-Bug: #1519493
Change-Id: I1aa3a5fd837d9156da4643a367013c869ed8bf9d
Currently LinuxBridge L2-agent[1] defines get_all_neutron_bridges which
lists all bridges managed by the agent including user-defined ones BUT
this method is only used by neutron-linuxbridge-cleanup[2] in order to
remove empty non-user-defined bridges returned get_all_neutron_bridges.
This change replaces this method by get_deletable_bridges which returns
bridges managed by LB agent which are "deletable" (ie: non user-defined).
This allows to simplify code and move the computation of "deletable"
bridges to LB agent code.
[1] neutron.plugins.ml2.drivers.linuxbridge.agent.linuxbridge_neutron_agent
[2] neutron.cmd.linuxbridge_cleanup
Partial-Bug: #1514548
Change-Id: I2f8a9a6982ce0ce77187ae4b7a58b3ef752aab34
Removal of empty bridges have been disabled [1] to fix a race condition
between Nova and Neutron where a bridge would be removed if
the only instance using it is rebooted. This means empty bridges
will pile up over time.
This script can be used to periodically remove empty bridges by running it
on compute nodes.
Note: Usage of this script can still trigger the original race condition.
It should be used when you don't expect anyone do be doing operations
on their instances.
[1] Commit 8dd8a7d935
DocImpact: Add neutron-linuxbridge-cleanup util
Related-bug: #1328546
Closes-bug: #1497027
Co-Authored-By: Cedric Brandily <zzelle@gmail.com>
Change-Id: Ieb2796381579ad295abf361ce483d979a53d2bd6