Commit Graph

8 Commits

Author SHA1 Message Date
Rajesh Tailor 8ab5ee1d17 Fix remaining typos in comments and tests
Change-Id: I872422cffd1f9a2e59b5e18a86695e5cb6edc2cd
2022-07-06 21:20:27 +05:30
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 <libosvar@redhat.com>
2022-04-13 05:49:15 +00:00
Sławek Kapłoński aaf11f45ec Switch IPDevice.exists() method to use pyroute2
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
2018-03-19 11:56:45 +01: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
Gary Kotton 396abb8ccb neutron-lib: start using neutron-lib helpers
The following helpers are used:
	parse_mappings
	compare_elements
	safe_sort_key

Change-Id: I5947b473330fd29f8d4c1a08f03d007a52c8dfd9
2016-10-10 01:30:26 -07:00
Doug Wiegley dd726ed494 Move i18n to _i18n, as per oslo_i18n guidelines
- 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
2015-12-01 19:29:10 -07:00
Cedric Brandily cc2d30eba4 Replace get_all_neutron_bridges by get_deletable_bridges
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
2015-11-11 10:14:23 +00:00
Mathieu Gagné 27f60c314b Add neutron-linuxbridge-cleanup util
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
2015-10-01 21:54:34 +02:00