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.
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.
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.
Ihar Hrachyshka [Thu, 11 Dec 2014 19:36:48 +0000 (20:36 +0100)]
Migrate to oslo.context
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.
Terry Wilson [Tue, 9 Dec 2014 22:24:37 +0000 (15:24 -0700)]
Have L3 agent catch the correct exception
L3 agent imports the processutils module to catch exceptions that
wouldn't ever be thrown because the underlying execute() being
called is the one from neutron.agent.linux.utils which raises a
RuntimeError on failure.
Also, processutils is now part of oslo.concurrency. So when we
actually start using it, we'll use it from there.
Carl Baldwin [Tue, 28 Oct 2014 17:30:55 +0000 (17:30 +0000)]
Remove broad exception catch from periodic_sync_routers_task
Although this change removes a broad exception from
periodic_sync_routers_task (neutron.agent.l3_agent), the
implementation still ensures if an exception --caught or uncaught --
prevents a call to the method to disable the fullsync, then the next
call to the method will perform a fullsync again.
Author: Cedric Brandily <zzelle@gmail.com> Co-Authored-By: Carl Baldwin <carl.baldwin@hp.com>
Change-Id: I6281886f3334100a18952578250c8154a0ed15a9
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.