Kevin Benton [Thu, 19 Jun 2014 07:19:28 +0000 (00:19 -0700)]
Remove __init__ method from TunnelCallback mixin
Removed an __init__ method from a mixin class that
made mixing with other classes fragile and inflexible.
This replaces it with an explicit setup method.
This allows the ML2 RPCCallbacks class to correctly
inherit the common RpcCallback class.
Kevin Benton [Thu, 19 Jun 2014 05:34:00 +0000 (22:34 -0700)]
OVS agent: Correct bridge setup ordering
This patch fixes three issues that combined to break tunnel networks.
The first issue was the the failure mode was being set on the
integration bridge after the canary flow was installed. This
immediately wiped out the canary flow.
The second problem was that the main loop would sync tunnel networks
right before resetting the tunnel bridge when the canary flow was
missing. This meant that it would sync all of the tunnels via RPC and
then wipe them out.
The final issue was that after resetting the tunnel bridge in the
main loop, the tunnel_sync variable was not set to True, so the
tunnels would never be resynchronized.
This patch addresses the three issues in the following ways:
1. Set the failure mode on the bridge before the canary flow is
installed.
2. Run the OVS restart logic before the tunnel synchronization.
3. If the restart logic is triggered, set tunnel_sync to True to
trigger synchronization.
YAMAMOTO Takashi [Fri, 20 Jun 2014 03:08:18 +0000 (12:08 +0900)]
ofagent: move main module from ryu repository
the recent oslo.messaging transition broke ofagent.
this commit fixes the regression.
historically the main module of ofagent has been maintained
in ryu's repository. this commit moves it into neutron's
repository and add common_config.init() call which is necesary
for the new rpc code.
Ralf Haferkamp [Wed, 18 Jun 2014 15:01:26 +0000 (17:01 +0200)]
Don't convert numeric protocol values to int
They are treated as strings everywhere. Converting them to int causes problems
when using postgresql as the database backend because it doesn't automatically
cast them back to integer.
berlin [Mon, 23 Jun 2014 02:16:34 +0000 (02:16 +0000)]
Revert "Check NVP router's status before deploying a service"
This reverts commit 25103df197c1f366eac8dd3069fabc01d3bd18e9.
Since it always leads to an gate failure filed on https://bugs.launchpad.net/neutron/+bug/1332502 although can't find the reason until now.
Sayaji [Fri, 20 Jun 2014 20:52:30 +0000 (13:52 -0700)]
Changing the poll_duration parameter type to int
The poll_duration parameter is defined as a Str in config.py
but while using in code, it is converted to int. So just changing
the type in the config file, so no conversion is required when used
Ihar Hrachyshka [Mon, 9 Jun 2014 13:14:14 +0000 (15:14 +0200)]
Removed 'rpc' and 'notifier' incubator modules
Port to oslo.messaging is done, so remove now unused pieces from the
tree.
Also removed obsolete bin/quantum-rpc-zmq-receiver. It comes from old
days of oslo-rpc, it was reimplemented later as
openstack/common/rpc/zmq_receiver.py in oslo-incubator, and we've
removed the whole tree for old RPC layer anyway.
Eugene Nikanorov [Wed, 18 Jun 2014 13:02:42 +0000 (17:02 +0400)]
Fix auto_schedule_networks to resist DBDuplicateEntry
This exception may happen if API and RPC workers are in different
processes.
Also make minor refactoring of auto_schedule_networks method
to avoid unnecessary db queries.
Add missing unit tests and adjust unit test naming style
TripleO's multi-node testing shows that this patch caused a failure to receive
tunnel updates, leading to the first node up to have no agent ports, the second
to have one agent port, the third to have 2 agent ports, etc. Needless to say,
this doesn't work all that well :)
Yalei Wang [Tue, 17 Jun 2014 02:56:46 +0000 (10:56 +0800)]
ValueError should use '%' instead of ','
The method _load_service_plugins() in /neutron/neutron/managers.py
throw a ValueError using ',' to connect log and variables.
ValueError do not support using ',' to connect log and variables,
we should use '%' instead of ','
This new flag will prevent updates on single resources, which
can happen asynchronously to the main synchronization thread,
from processing the 'changed' flag for items in the cache and
delete items not present anymore in NSX.
This will avoid failures seen in CI runs where the sync
thread failed because of a KeyError because some items where
concurrently removed from the NSX cache.
Ihar Hrachyshka [Mon, 9 Jun 2014 12:42:25 +0000 (14:42 +0200)]
Renamed argument for create_consumer[s]
Now that we don't have explicit dispatcher class to pass into RPC layer,
and we pass a list of endpoints instead, fix names for corresponding
arguments of the functions.
Ihar Hrachyshka [Mon, 2 Jun 2014 15:40:38 +0000 (17:40 +0200)]
Port to oslo.messaging
Now that all preparations are done, actually port the code to use
oslo.messaging. This patch does as little as possible. Follow up patches
that refactor and cleanup the code and configuration files, will be
merged later. The reason for this is to make the patch as slim as
possible, to make review process more smooth and concentrated.
Details:
* neutron/common/rpc.py:
- added init() and cleanup() to set global RPC layer state.
- added utility functions: get_server(), get_client(), get_notifier()
that wrap up oslo.messaging API a bit, enforcing eventlet executor
and setting serializer, among other things.
- removed PluginRpcDispatcher, instead introduced PluginRpcSerializer
to use as a default serializer for API callbacks.
* neutron/common/rpc_compat.py:
- emulated incubator RPC layer behaviour thru previously introduced
stub classes (RpcCallback, RpcProxy, ...) using new oslo.messaging
API.
- switched to using new oslo.messaging exception types.
* neutron/service.py:
- expect multiple RPC listeners that are of MessageHandlingServer
type, not GreenThread.
* neutron/common/config.py:
- initialize RPC layer in init()
* setup.cfg:
- added entry points for old notifier drivers to retain backward
compatibility.
* neutron/tests/...:
- introduced fake_notifier to replace impl_fake.
- faked out consume_in_thread() to avoid starting RPC listeners when
running unit tests.
- used 'fake' transport driver.
- made sure neutron.test.* exceptions are caught.
- initialize and clean up RPC layer for each test case.
* Ported all affected code from using neutron.openstack.common.notifier
API to oslo.messaging.Notifier.
* rpc.set_defaults() was renamed to rpc.set_transport_defaults()
Terry Wilson [Wed, 18 Jun 2014 03:32:56 +0000 (22:32 -0500)]
Pass 'top' to remove_rule so that rule matching succeeds
When deleting a vpn-site-connection, deleting the nat rule would
fail because it was created with top=True, but top defaults to
'false' in remove_rule and was not being passed. This caused the
rule matching to fail and the rule to not be deleted.