This dictionary does not belong to the plugins directory as it captures
API business, but practically speaking it does not even deserve to exist
and can be removed altogether.
This is patch one in a series that aims at addressing this monkey business.
A missing entry causes a KeyError that leads the server to blow up during
startup. We can fallback on an empty path (like some services do), in case
the prefix is not specified.
Furthermore, we can be declarative with this property, the same way we are
with properties like aliases, bulk support, etc.
devref: document API status for neutron.openstack.common.*
Make sure we document the fact that neutron.openstack.common.* contents
are not meant to be used by external repositories (except, temporarily,
*aas repos).
If I could bootstrap the oslo-incubator subtree from scratch, I would
put it under neutron._openstack, to indicate that it's for internal
usage only. But we can't do it now, so instead I update devref.
Pavel Bondar [Thu, 25 Jun 2015 13:32:22 +0000 (16:32 +0300)]
Collapse create_subnet into single method
Previously create_subnet called different methods for subnet allocation
with subnetpool and without it.
_create_subnet_from_implicit_pool and _create_subnet_from_pool
were collapsed into single method _create_subnet.
This is intermediate step for supporting pluggable ipam.
Kevin Benton [Thu, 2 Jul 2015 08:45:46 +0000 (01:45 -0700)]
Downgrade log level for gone port on status update
If a port is deleted immediately before a status update arrives
from the L2 agent, the port will be missing from the DB. The current
code was logging this at the warning level, but this occurs during
normal operations so it should only be a debug event.
Kevin Benton [Wed, 1 Jul 2015 20:06:38 +0000 (13:06 -0700)]
Change the half of the bridge name used for ports
The code to generate the names of the patch ports
was based on a chunk of the bridge name starting from
the beginning. With the long suffix, this ended up
excluding all of the random characters in the name.
(e.g. br-int374623235 would create an interface br-in-patch-tun).
This meant that if two tests using patch interfaces ran together,
they would have a name collision and one would fail.
This patch updates the patch port name generation to use the
randomized back portion of the name.
Patch 4e77442d5 added a retry decorator to the API layer
to catch DB deadlock errors. However, when they occur, the
retried operation ends up being ineffective because the original
body has been altered, which leads the notification and validation
layers to barf exceptions due to unrecognized/unserializable elements.
This ultimately results to an error reported to the user.
To address this, let's make a deep copy of the request body, before
we pass it down to the lower layers. This allows the decorator to
work on a pristine copy of the body on every attempt. The performance
impact for this should be negligible.
Robert Collins [Mon, 29 Jun 2015 21:40:17 +0000 (09:40 +1200)]
Improve fixture usage.
There were two broad issues with fixtures.
Firstly, the 'SafeFixture' workaround for resource leaks in fixtures
<1.3 is not needed if we depend on fixtures>=1.3.1. While testtools
may raise a TypeError when trying to query a fixture that failed to
setup, this is only ever a cascading failure - it will not cause
tests to fail, cause leaks, or cause tests to incorrectly pass. That
will be fixed in testtools soon to stop it happening (but as it cannot
affect whether a test passes or fails or leaks happen there is no
reason to wait for that). Leaks are seen with fixtures 1.3.0 still
because eventlet raises a BaseException subclass rather than an
Exception subclass, and fixtures 1.3.0 didn't handle that - 1.3.1 does.
Secondly, some of the fixtures had race conditions where things were
started and then cleanups scheduled. Where possible I've fixed those,
but some of them require more significant work to fully address.
Assaf Muller [Tue, 30 Jun 2015 17:22:17 +0000 (13:22 -0400)]
Disable pylint job
Disabling pylint until it gets unbroken. Pylint 1.4.1 is using
logilab-common, which had a release on the 30th, breaking pylint.
Pylint developers are planning a logilab-common release tomorrow
which should unbreak pylint once again, at which point I'll
re-enable pylint.
Sean M. Collins [Tue, 30 Jun 2015 16:06:07 +0000 (12:06 -0400)]
Remove bridge cleanup call
Remove the bridge cleanup call to delete bridges, since we are seeing
race conditions where bridges are deleted, then new interfaces are
created and are attempting to plug into the bridge before it is
recreated.
Russell Bryant [Tue, 26 May 2015 21:07:37 +0000 (17:07 -0400)]
Move windows requirements to requirements.txt
Commit 276028cca26af573c14938255e40c58358eabd4a added these
requirements to setup.py from a custom build hook. These requirements
can now be expressed in requirements.txt. We need to move them there
so that the global requirements sync job can continue to keep setup.py
in sync with the global version.
Kevin Benton [Tue, 30 Jun 2015 05:24:22 +0000 (22:24 -0700)]
Increase ping count on ARP spoof test
The other IPv4 tests all have a count of 2 to tolerate
ping failures due to slow ARP response/interface setup/etc.
This patch increases test_arp_spoof_allowed_address_pairs_0cidr
to 2 to match.
Kevin Benton [Fri, 29 May 2015 06:13:19 +0000 (23:13 -0700)]
Read vif port information in bulk
During startup, the agent was making many calls per port
to read information about the current VLAN, external ID, etc.
This resulted in hundreds of calls just to read information about
a relatively small number of ports.
This patch addresses that by converting a few key functions to
lookup information for all of the ports at once.
Performance improvement on dev laptop for 250 ports from agent
start to port ACTIVE status:
before: 1m21s
after: 1m06s
Assaf Muller [Mon, 29 Jun 2015 15:38:51 +0000 (11:38 -0400)]
Remove failing SafeFixture tests
The fixtures 1.3 release attempted to fix the fixtures resource
leak issue, but failed to do so completely. Our own SafeFixture
is still needed: The 1.3 release broke our SafeFixture tests,
but not the usage of SafeFixture itself. This patch removes
those failing tests for now to unbreak the gate. Jakub reported
a bug on fixtures 1.3:
https://bugs.launchpad.net/python-fixtures/+bug/1469759
We will continue to use SafeFixture until that bug is fixed
in fixtures, at which point we will be able to require
fixtures > 1.3.
We pulled all of the plugins out of the tree, many of which still inherit
from neutron test classes. This change then stated that we no longer
support testing other plugins. I think this is a bit premature and should
have been discussed under the subject
"Neutron plugins can't use neutron plugin unit tests" or something
similar.
Tomoaki Sato [Mon, 29 Jun 2015 01:02:20 +0000 (10:02 +0900)]
Fix subnet updating failure on valid allocation pools
Currently subnet updating with both allocation-pool and
gateway_ip options is failing because of wrong parameter check.
The check always checks gateway_ip against allocation pools in
db, even when the allocation_pool parameter is given.The fix
checks if given parameter of gateway_ip option doesn't conflict
with given parameters of allocation-pool.
When troubleshooting problems with cluster it would be
very convenient to have information about agent heartbeats
logged with some searchable identifier which could create
1-to-1 mapping between events in agent's logs and server's logs.
Currently agent's heartbeats are not logged at all on server side.
Since on a large cluster that could create too much logging
(even for troubleshooting cases), it might make sense to make
this configurable both on neutron-server side and on agent-side.
Assaf Muller [Fri, 26 Jun 2015 21:17:14 +0000 (17:17 -0400)]
Revert "Fix 'router_gateway' port status can't be updated"
This patch breaks multinode fullstack tests and in my opinion
is generally speaking wrong. I've added a comment to explain
in the patch that's being reverted.
This reverts commit with change ID:
If428eadadfd36a9b19ea75920120e48ac49659f2
Jakub Libosvar [Wed, 17 Jun 2015 13:10:13 +0000 (13:10 +0000)]
Move NetcatTester to common/net_helpers
The NetcatTester is a testing tool that can be used also in fullstack
tests so I think it should go there to avoid imports in fullstack tests
from functional.
Jakub Libosvar [Fri, 5 Jun 2015 14:32:51 +0000 (14:32 +0000)]
Refactor NetcatTester class
Following capabilities were added:
- used transport protocol is passed as a constant instead of bool
- src port for testing was added
- connection can be established explicitly
- change constructor parameters of NetcatTester
As a part of removing bool for protocol definition
get_free_namespace_port() was also modified to match the behavior.
Kevin Benton [Fri, 26 Jun 2015 01:34:38 +0000 (18:34 -0700)]
Add a double-mock guard to the base test case
Use mock to patch mock with a check to prevent multiple active
patches to the same target. Multiple patches to the same target
result in non-deterministic behavior when stopall() tries to
undo the patches.[1]
Kevin Benton [Fri, 26 Jun 2015 05:08:41 +0000 (22:08 -0700)]
Remove duplicated mock patch of ip_lib
The functional tests for agents were patching ip_lib in the
function to configure an agent, so any tests that relied on
multiple agents would patch ip_lib multiple times.
Kyle Mestery [Thu, 25 Jun 2015 20:36:47 +0000 (20:36 +0000)]
Consolidate sriov agent and driver code
In preparation for decomposing the built-in reference implementation,
this commits consolidates the sriov agent and driver code into a
coherent place for it's life in the new repository. I've also given
the unit tests a new home.
Kyle Mestery [Wed, 24 Jun 2015 19:12:06 +0000 (19:12 +0000)]
Restructure agent code in preparation for decomp
This commit moves the L2 agents (Linuxbridge and OVS) into the
ML2 directory, while at the same time also moving the ML2 server
bits into toplevel directories. It also moves the configuration
files and unit tests. We also move the l2pop RPC mixin while
here as well.
sridhargaddam [Mon, 22 Jun 2015 14:13:56 +0000 (14:13 +0000)]
Fix ip_lib get_gateway for default gateway on an iface
Currently get_gateway() of IpRouteCommand class always assumes
the presence of gateway_ip when default_route is seen.
Since we can also have interface routes without the gw_ip,
this patch fixes the issue by parsing the output accordingly.
IPv6 does not have a subnet broadcast address so the last IP
address can be used as a regular address. This patch tweaks the
automatic allocation pool generation to include that last address
on v6 networks.
This was found because
NetworksTestDHCPv6.test_dhcp_stateful_fixedips_outrange makes the
assumption that the default generated pools cover the entire usable
address space.