RobinWang [Wed, 10 Dec 2014 02:46:05 +0000 (10:46 +0800)]
Mock up time.sleep to avoid unnecessary wait in test_ovs_tunnel
Unnecessary wait in ovs tunnel UT introduces extra 6 seconds time cost,
and makes 3 test_daemon_loop cases the slowest tests. Mock up time.sleep
to reduce UT time, from around 6.272s to 0.135s.
Ian Wienand [Thu, 4 Dec 2014 00:31:23 +0000 (11:31 +1100)]
Print version info at start
When debugging problems from logs, it would be useful to know what
version is running across program start and stop. In one case I have
a suspicion that an upgrade was run inbetween but the logs don't help
identify that.
My first thought was to grab this from argparse just as --version
does, but that's not really currently possible [1].
The original starting message is probably irrelevant, but I realise
log messages tend to suffer from Hotel California syndrome; you can
check-in but you can never leave.
Gary Kotton [Tue, 2 Dec 2014 12:27:07 +0000 (04:27 -0800)]
Enforce log hints in ofagent and oneconvergence
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/ofagent
neutron/plugins/oneconvergence
Yalei Wang [Wed, 3 Dec 2014 05:29:30 +0000 (13:29 +0800)]
return the dict of port when no sec-group involved
Commit abc16ebf made the get_sg_ids_grouped_by_port function not return
entries for ports without security groups. This causes the agent to not remove
previously created security groups for that port since the port is not
returned in the security_group_info_for_devices data.
This change fixes that by always including a list of security groups for each
port, even if that list is empty.
tox.ini: Prevent casual addition of bash dependency
While bash is not available on every environments, there seems to be
a tendency to introduce more bash dependency very casually. This check
is intended to be a reminder to give people a chance to consider
alternatives.
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.
Cedric Brandily [Tue, 25 Nov 2014 13:44:18 +0000 (13:44 +0000)]
Enforce log hints in neutron.plugins.plumgrid
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/plumgrid
Cedric Brandily [Wed, 26 Nov 2014 00:31:22 +0000 (00:31 +0000)]
Remove ovs-vsctl call from OVSInterfaceDriver
ovs_lib module is responsible for the interaction with OVS but
OVSInterfaceDriver._ovs_add_port() method calls directly
ovs-vsctl which implies inconsistencies: ovs_lib calls ovs-vsctl
with a timeout but not OVSInterfaceDriver._ovs_add_port().
This change moves ovs-vsctl call in OVSInterfaceDriver._ovs_add_port
to ovs_lib.
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.
A recent change (commit 0d5a11d9c722870f9c5e31a993219c7e240b4e19)
introduced bash dependency. It broke my environment, where bash
is not available. This change aims to restore it.
As far as I undestand, the change in question requires bash for
the "pipefail" feature. Fortunately there's a more portable
well-known trick for the purpose.
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.