There are a small number of examples of "eager" interpolation in
neutron:
logging.debug("foo %s" % arg)
These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.
This change addresses all such examples found in brocade
l3_router_plugin via a pylint test. Other occurrences are addressed
elsewhere.
Change-Id: Ia2d51e8ecbc7af81390577ec69c5ce18523b65f3
Partial-Bug: #1404788
New policy code requires that CONF is already initialized when policy
checks are invoked. It means that no Neutron context objects should be
created before BaseTestCase.setUp() is called that will set
configuration, among other things.
Ideally, we would just make sure that all test cases invoke
super().setUp() as the very first line of any subclass setUp() methods.
But since some of test cases require prior setup (like mocking extension
manager) before proceeding to base class, we end up with magically
shuffling context instantiations to occur below super() calls.
Change-Id: Ib1039ea1ff9480ca57f9cb0c917469d0d2ad28b8
Closes-Bug: #1400301
That's just a matter of adding requirements.txt entry, fixing imports,
and dropping the corresponding oslo-incubator module from the tree.
While at it, made all imports to import the module into 'oslo_context' and
not just 'context', so that we don't override the module locally in
multiple methods that receive their context arguments with the same
name, making the library inaccessible from inside those methods.
Change-Id: Ie62af970b3b7f225de453e56c01abc4b12af8f5e
Closes-Bug: #1401054
Mostly trivial import changes.
- oslo.i18n no longer provide install() method to inject _() into
globals(), so removed all calls to it;
- removed Babel from dependencies (it will now be grabbed by oslo.i18n);
- updated tox.ini to ignore import violations for oslo.i18n.
Change-Id: I6623d551f512fb7fe9bf35ee734ed6d4c6cbc287
All the existing LOG.info, LOG.warning, LOG.error and LOG.critical
messages should have _LI, _LW, _LE and _LC respectively.
Also, debug level log shouldn't be translated.
This patch set will cover the ml2 directory under neutron/plugins.
Partial-Bug: #1320867
Change-Id: I9d78d23bbc14e7c536c6ddf2dc4f52c67faeb667
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule.
Validate that hacking rules apply to directories:
- neutron/services/l3_router
Change-Id: I2a832c5e0c4ed2a944d199d6a2d6233b8cf838dd
Partial-bug: #1320867
This change corrects H401 (docstring should not start with a space)
errors and enables the check
Change-Id: I2f798421d5895fcec349c757d27b7f085ee001e7
Partial-Bug: 1329017
In unit tests for several ML2 mechanism drivers (listed below)
the NeutronDbPluginV2TestCase class is used instead of Ml2PluginV2TestCase
which is desired to be used.
Unit tests for ML2 mechanism drivers in neutron/tests/unit/ml2:
drivers/cisco/nexus/test_cisco_mech.py
drivers/brocade/test_brocade_mechanism_driver.py
drivers/freescale/test_mechanism_fslsdn.py
test_mechanism_ncs.py
test_mechanism_odl.py
test_l2population.py
Partial-Bug: #1373153
Change-Id: I9524cafb39975b1384954a2eefcbf754231d2198
This exception code catches all exceptions, and then always raises them
again.
More interestingly, it uses excutils.save_and_reraise_exception
incorrectly (outside a `with` statement), which triggers the pylint test
designed to catch exactly this.
Change-Id: Iab9d69944cbae5257682ac65ff2b8fba3ef7017e
We have git to track authorship, so let's not pad source files
with it as well.
A hacking check has been added for this. The value is N322.
Change-Id: Iab0b64d417e0bb41a6b455e2ac377deee64ec3ee
NETCONF temaplates for NOS version greater than 4.1.0 are slightly
different (argh). An init time check of the NOS version is done
to enable selection of the correct NETCONF templates.
Change-Id: I01e82ad402fbbb25d92a99a3325ca2608dd514cb
Closes-bug: #1332719
This causes problems when the customer installs the ml2
plugin/mechanism driver without the Brocade plugin.
Fixes bug: #1326937
Change-Id: I2d0dfda2cdfbdfd8503351b191151cb02104dcce
oslo.config.CONF.reset is added to cleanup in BaseTestCase, so it does
not need to be done by individual test cases.
Change-Id: I5fced5c2d480e78e5bb7cc150f0b653313884456
Closes-Bug: #1291144