Jakub Libosvar [Tue, 30 Sep 2014 16:13:50 +0000 (18:13 +0200)]
Separate wait_until to standalone function
It makes wait_until more usable outside of unittest.TestCase classes.
Part of this patch is renaming pinger module to helpers thus we can have
helpers module with useful utilities for testing.
Kevin Benton [Thu, 16 Oct 2014 09:10:36 +0000 (02:10 -0700)]
Catch duplicate errors scheduling SNAT service
Catch DBDuplicateEntry errors when scheduling SNAT to
a service node to prevent harmless tracebacks in the log.
These can occur if scheduling occurs concurrently,
so they are safe to ignore.
Michael Smith [Tue, 2 Dec 2014 22:22:04 +0000 (14:22 -0800)]
Fix for KeyError: 'gw_port_host' on l3_agent
The dictionary field 'gw_port_host' was added for
DVR routers and is used by the scheduler and l3_agent
to schedule where the SNAT port for a DVR router
will be hosted. In some code flows on the l3_agent,
this field is checked to determine what the agent
should do if the host matches its own or not.
Recently it has been seen that the router data sent
from the scheduler is missing this field in some cases.
This causes the agent to throw a KeyError and not function
properly. This patch will make the l3_agent more robust
and less fragile by calling 'get' instead of assuming the
field will be there.
More work may be needed on the scheduler side to see why
this field is missing. That is why I am marking this as a
partial-fix for now. But this patch will make the l3_agent
less prone to errors and therefore an improvement.
Miguel Angel Ajo [Wed, 10 Dec 2014 11:21:52 +0000 (12:21 +0100)]
Fix race condition in ProcessMonitor
If any new external process was enabled/disabled during
the process monitoring loop time, a RuntimeError: dictionary
changed size during iteration was thrown. This is fixed
by pre-building the service list from the dictionary
for the iteration.
Miguel Lavalle [Tue, 9 Dec 2014 00:40:25 +0000 (18:40 -0600)]
Refactor process_router method in L3 agent
Refactors the process_router method of the L3NATAgent class to several methods
that coherently group functionallity. The aim is to make the code more readable
and maintainable. There is no functional change in this patch.
Carl Baldwin [Mon, 1 Dec 2014 21:49:10 +0000 (16:49 -0500)]
Move classes out of l3_agent.py
The file l3_agent.py has become too large. This patch is a simple
pure refactor to move some of the functionality in to other files
where things aren't too tangled up. There is no functional change
with this patch and I avoided gratuitous other fixups in this patch in
order to make it easier to review.
I plan to follow up on the new l3_dvr and l3_agent_router modules with
more restructuring in the near future.
Change I6a079ad introduced some magic to enable showing test output
as the test run. Do the same for *-functional tests too, by reusing
the default testenv
Doug Wiegley [Tue, 9 Dec 2014 22:55:04 +0000 (15:55 -0700)]
Services split, pass 2
- Nuke more services code, killing some refs in vmware plugin
- Vmware plugin foreign key relationships are temporary disabled
- Vmware unit tests are temporarily disabled
- Remove router insertion test, as its only user is going away
- Add thin service plugin shims
- Temporarily disable model sync test
Post services-split, existing neutron.conf configurations may contain
references to in-tree plugin classes. Add thin shims so that those configs
will continue to work.
Xu Han Peng [Wed, 10 Dec 2014 06:07:42 +0000 (14:07 +0800)]
Fix IPv6 RA security group rule for DVR
Current IPv6 RA security group rule doesn't work for
DVR because the code only allows RA from device_owner
is network:router_interface. When DVR is enabled, the
router interface is network:router_interface_distributed.
This fix fixes the RA rule to allow RA from DVR router
interface, so router advertisement from DVR RADVD can
pass to VM.
Co-Authored-By: Baodong (Robert) Li <baoli@cisco.com>
Change-Id: Idd1324c653dcb15f5dacf2d897a7048bca22fc38
Partial-Bug: 1376325
Doug Wiegley [Mon, 8 Dec 2014 04:21:57 +0000 (21:21 -0700)]
Split services code out of Neutron, pass 1
- After l3_agent is refactored, need to remove services/firewall
- After vmware plugin moves services out of monolothic,
remove model copies and services/loadbalancer/constants,
and re-enable unit tests.
- After alembic chain gets split in four, tweak models/head and
fix heal/current chain.
- Re-factor test_routerserviceinsertion into one of the service repos
Angus Lees [Mon, 25 Aug 2014 02:26:00 +0000 (12:26 +1000)]
Use comments rather than no-op string statements
This change replaces a few no-op string statements with regular
comments. While there was no harm in the previous use of strings for
comments, this allows us to re-enable the corresponding pylint check
which may catch genuinely unintended cases.
Cedric Brandily [Sun, 7 Dec 2014 20:35:16 +0000 (21:35 +0100)]
Enforce log hints
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule
and the change respects logging guidelines.
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.
Ihar Hrachyshka [Wed, 3 Dec 2014 11:44:57 +0000 (12:44 +0100)]
radvd: pass -m syslog to avoid thread lock for radvd 2.0+
Since radvd 2.0, the daemon does not use daemon_fork() function from
libdaemon, but instead calls Linux daemon() function directly. It also
passes (1, 1) arguments when logging method (-m) is either stderr (the
default) or stderr_syslog. The second argument's value = 1 means that
stderr is not closed and left there for (some) log messages.
For neutron, it means that corresponding execute() call that spawns
radvd and expects the invoked process to close stderr does not ever get
completed. The current thread that spawned radvd is locked waiting for
radvd to exit, which does not ever occur unless the process crashes or
receives a signal.
Since L3 agent gives exclusive access to updates queue for each router
to one of processing threads only, it means that the thread that got to
serve a radvd-powered subnet will not proceed and not update any new
ports or other changes to the router anymore.
Passing -m syslog makes radvd 2.0+ close stderr and return to execute()
caller, proceeding with router update processing. The same arguments
should work for old (pre 2.0) versions of radvd too, so passing them
unconditionally.
We could instead use -m logfile and pass appropriate -l <logfile>
argument to radvd to make it log to a log file located in router's
namespace storage path. Though that would be not in line with what
dnsmasq processes currently do for dhcp agent, where we log all messages
to syslog, so sticking to syslog for radvd for consistency.
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.