Russell Bryant [Tue, 2 Dec 2014 21:16:19 +0000 (21:16 +0000)]
Convert several uses of RpcCallback
Convert several places in the code that were using the RpcCallback
compatibility class. This class eased the transition to
oslo.messaging. This patch drops the usage of this class in favor of
direct usage of the appropriate oslo.messaging API.
Russell Bryant [Tue, 2 Dec 2014 16:23:40 +0000 (16:23 +0000)]
Fix up an old RpcProxy assumption
This patch fixes one last bit of code that assumed that the base
PluginApi used RpcProxy. This code is now fixed to use the proper
oslo.messaging APIs instead.
Aaron Rosen [Tue, 18 Nov 2014 23:59:40 +0000 (15:59 -0800)]
Fix enable_metadata_network flag
The following patch: 9569b2fe broke the desired functionality of
the enable_metadata_network flag, by not allowing the metadata
proxy to be spawn for 'metadata networks', which are used for
accessing the metadata service when the logical router is not
implemented through the l3 agent.
This patch enables spawning of the metadata proxy for metadata
networks when the appropriate flag is set to True.
The patch also adds rather pedant unit test coverage for the
should_enable_metadata method which previously had no unit test.
Gary Kotton [Tue, 2 Dec 2014 12:35:51 +0000 (04:35 -0800)]
Enforce log hints in opencontrail
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule
and the change respects loggging guidelines. Validate that hacking
rules apply to directories:- neutron/plugins/opencontrail
Gary Kotton [Wed, 26 Nov 2014 17:01:36 +0000 (09:01 -0800)]
Update i18n translation for Metaplugin plugin
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
metaplugin directory.
Gary Kotton [Tue, 25 Nov 2014 09:46:50 +0000 (01:46 -0800)]
Update i18n translation for Embrane plugin
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
embrane directory.
Gary Kotton [Tue, 25 Nov 2014 10:28:54 +0000 (02:28 -0800)]
Update i18n translation for Midonet plugin
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 midonet
directory.
Cedric Brandily [Tue, 25 Nov 2014 13:30:23 +0000 (13:30 +0000)]
Enforce log hints in neutron.plugins.sriovnicagent
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule and
the change respects loggging guidelines.
Validate that hacking rules apply to directories:
- neutron/plugins/sriovnicagent
Cedric Brandily [Tue, 25 Nov 2014 12:56:50 +0000 (12:56 +0000)]
Enforce log hints in neutron.plugins.hyperv
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule and
the change respects loggging guidelines.
Validate that hacking rules apply to directories:
- neutron/plugins/hyperv
Maru Newby [Sat, 8 Nov 2014 17:08:33 +0000 (17:08 +0000)]
Fix base test class for functional api testing
To support in-tree functional api testing, the test class common
across all types of testing can't import modules that define
configuration that Tempest also defines because duplicate
configuration definitions result in runtime errors. A previous change
(I44251db399cd73390a9d1931a7f253662002ba10) moved conflicting imports
to a separate module, but subsequent additions have added new conflicting
imports.
This change creates a new test class that is safe to use for all types
of testing (neutron.tests.sub_base.SubBaseTestCase), ensures that the
existing existing base test class (neutron.tests.base.BaseTestCase)
extends it, and documents their respective responsibilities. This
will hopefully make it less likely that the functional api job will be
broken by changes to the base test class.
Maru Newby [Sat, 8 Nov 2014 17:20:37 +0000 (17:20 +0000)]
Use oslo function for parsing bool from env var
The tests were previously defining their own way of parsing booleans
from strings. This change switches to using a function defined in
the oslo.utils.strutils module.
Russell Bryant [Mon, 1 Dec 2014 20:13:12 +0000 (20:13 +0000)]
Don't block on rpc calls in unit tests
While running unit tests I noticed that all of the test cases from
TestOvsNeutronAgent were taking just over 15 seconds. This is because
it was waiting for the rpc call response timeout. Since the tests
weren't actually failing, it's clear the code doesn't actually care
about the response anyway, so just set the messaging config to not
wait for the response.
On my dev box, this dropped test runtime for this file from 1024
seconds to 3 seconds, which is an obvious *HUGE* improvement.
Someone pointed out that an earlier change
(086496bfc45e01cd2905a074d526a7d513bf4ec2) intended to make calls
return immediately for *all* tests, but removing use of RpcProxy
caused this to stop working.
iptables_manager: Fix get_binary_name for eventlet
The inspect trick used by get_binary_name does not work for
eventlet non-main threads. It's actually the case for ofagent
and in that case it yields something like "greenthread.py",
which is not desirable because this module assumes it different
for each programs. This commit fixes the problem by switching
to use sys.argv.
Russell Bryant [Mon, 1 Dec 2014 19:15:58 +0000 (19:15 +0000)]
Drop old code from SecurityGroupAgentRpcApiMixin
The SecurityGroupAgentRpcApiMixin class temporarily had support for
both RpcProxy and new oslo.messaging style rpc client interfaces. Now
that all users of this mixin have been converted to direct usage of
oslo.messaging APIs, the old compatibility code can be removed.
Russell Bryant [Mon, 1 Dec 2014 18:42:30 +0000 (18:42 +0000)]
Drop RpcProxy usage from ml2 AgentNotifierApi
Remove usage of the RpcProxy compatibility class from the ml2
AgentNotifierApi. The equivalent oslo.messaging APIs are now used
instead. A couple of other mixin APIs had to be converted at the same
time.
Note that there is one very minor functional change here. The base
rpc version is set to '1.0' now instead of '1.1'. The right pattern
to use is to always set the base to be N.0. Any method that needs a
newer version should specify it.
Irena Berezovsky [Sun, 23 Nov 2014 13:39:09 +0000 (15:39 +0200)]
Update i18n translation for Mellanox plugin and agent log msg's
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 mlnx
directory under neutron/plugins.
Gary Kotton [Thu, 20 Nov 2014 19:53:27 +0000 (11:53 -0800)]
Update i18n translation for VMware NSX plugin log msg's
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 vmware
directory under neutron/plugins.
Mike Bayer [Mon, 1 Dec 2014 03:18:32 +0000 (22:18 -0500)]
Alter execute_alembic_command() to not assume all commands
Alembic 0.7.1 is adding new diff directives add_fk and remove_fk.
The logic in execute_alembic_command() appears to assume all potential
commands are present in METHODS. This patch adjusts it so that
it checks METHODS first, allowing the tests in neutron.tests.unit.db.test_migration
to pass. However, if the design here requires that all potential
Alembic commands are handled, then this would not be the fix,
though I recommend that the potential list of Alembic directives
not be hardcoded.
Kevin Benton [Thu, 27 Nov 2014 09:45:29 +0000 (01:45 -0800)]
Fix hostname validation for nameservers
Fixes the hostname validation to align with the RFC's demands[1].
This was done by replacing the full regex with a function that
broke the FQDN into individual components that were easier to
reason about with regular expressions.
Also added several test cases for domains so if someone wants
to convert it back to pure regex there will be better test vectors.
1. RFC 1123 says an all-digit hostname is allowed in section 2.1. It
says that this more liberal syntax MUST be supported.
Angus Lees [Wed, 13 Aug 2014 05:42:10 +0000 (15:42 +1000)]
Enable undefined-loop-variable pylint check
This required a trivial refactor of two existing cases in the codebase.
These two cases were perfectly correct, but the check uncovered a 3rd
case which was a real bug (fixed separately). The new versions also
make it clear that if the loop fails to break early then the 'result' is
None (and thus an error) and not simply the last element. On balance,
it's probably worth enforcing this small inconvenience to coding style.
abhishek.talwar [Wed, 19 Nov 2014 09:54:42 +0000 (15:24 +0530)]
Change description of default security group
The description for default security group in neutron
is “default”.
This confuses the end users, so updated the description
from “default” to “Default security group”.
Closes-Bug: #1291570
Angus Lees [Mon, 25 Aug 2014 02:02:16 +0000 (12:02 +1000)]
Fix incorrect exception order in _execute_request
_execute_request has a list of exception handlers to log various types
of errors with more specific error messages. Unfortunately, it catches
requests.exceptions.ConnectionError before requests.exceptions.SSLError,
but ConnectionError is a superclass of SSLError so the latter is never
invoked.
This change corrects the exception handling order, and enables the
bad-except-order pylint check now that the check passes.
Ihar Hrachyshka [Fri, 21 Nov 2014 21:01:08 +0000 (22:01 +0100)]
Migrate to oslo.i18n
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.
gordon chung [Wed, 8 Oct 2014 21:51:47 +0000 (17:51 -0400)]
Migrate to oslo.middleware
Synced middleware module from incubator instead of removing it
completely. This is needed for grenade and to keep backwards
compatibility with existing installations with old api-paste.ini.
'log' module is updated as a dependency for middleware module.
'versionutils' are added as a new dependency for middleware module.