Kevin Benton [Wed, 18 Jun 2014 19:03:01 +0000 (12:03 -0700)]
Allow setting a tenant router's external IP
Adds an external_ip option to the router creation
and update operations to set the IP address the router
will try to use as its fixed IP on the external network
it's attached to. By default this is restricted to an
admin-only operation by policy.json.
Cedric Brandily [Fri, 19 Dec 2014 14:05:53 +0000 (15:05 +0100)]
get_binary_name should returns strings without spaces
Iptables does not support chain names with spaces. It implies
get_binary_name should return strings without spaces (they are used as
chain name prefix). But currently 'python -m unittest $module' implies
spaces in get_binary_name() result, it disallows to use it when $module
is a functional test module. This change replaces spaces with
underscores in get_binary_name results.
Angus Lees [Fri, 28 Nov 2014 01:23:47 +0000 (12:23 +1100)]
Tighten dnsmasq version regex
The previous regex forgot to escape the '.', resulting a more liberal
match than intended. Luckily it continued to work, since the dnsmasq
version is the first number that appears in the --version output.
This change improves the regex to correctly escape the '.' (as
presumably originally intended) and to look for the prefix "version ".
Angus Lees [Fri, 28 Nov 2014 01:18:49 +0000 (12:18 +1100)]
Remove unnecessary regex grouping
Several regexes in this class used had unnecessary (\s+) grouping. This
change makes the regexes slightly cheaper by removing the need for the
regex engine to remember the whitespace that was matched.
Robert Pothier [Mon, 22 Dec 2014 16:42:35 +0000 (11:42 -0500)]
ML2 UT: Fix incorrect mock return value
In the UT for ML2 Cisco Nexus MD,
in the function test_ncclient_version_detect()
The value being passed into the mock is incorrect
to mock the ncclient connect object.
Ihar Hrachyshka [Thu, 27 Nov 2014 14:43:48 +0000 (15:43 +0100)]
ipv6: set OtherConfig flag for DHCPv6 stateless subnets
In case of DHCPv6 stateless subnets, we should inform DHCP clients about
other configuration values available from DHCP server. This is done by
setting O (other) flag in RAs, which is controlled by AdvOtherConfigFlag
setting in radvd case.
Since radvd configuration file becomes quite complex, migrated its
generation to Jinja2.
Added a basic unit test that checks that flag is set for stateless mode
and not SLAAC. For stateful, it doesn't really matter whether other flag
is set, so no need to expect any value of it.
No more unit tests seem to be needed: conditional prefix generation is
already covered in test_l3_agent, and other statements are common for
all ipv6_ra_modes.
Fawad Khaliq [Sun, 21 Dec 2014 20:57:27 +0000 (12:57 -0800)]
PLUMgrid plugin: Fix for delete subnet with admin context
When delete call using admin for a subnet created from a
non-admin project is made, the tenant_id passed to backend
happened to be of admin project. This commit fixes the issues
by getting the correct tenant_id.
Angus Lees [Mon, 22 Dec 2014 04:40:03 +0000 (15:40 +1100)]
embrane: Use lazy logging interpolation
There are a small number of examples of "eager" interpolation in
neutron:
logging.debug("foo %s" % arg)
These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.
This change addresses all such examples found in embrane via a pylint
test. Other occurrences are addressed elsewhere.
Angus Lees [Mon, 22 Dec 2014 04:38:40 +0000 (15:38 +1100)]
bigswitch: Use lazy logging interpolation
There are a small number of examples of "eager" interpolation in
neutron:
logging.debug("foo %s" % arg)
These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.
This change addresses all such examples found in bigswitch via a pylint
test. Other occurrences are addressed elsewhere.
Angus Lees [Mon, 22 Dec 2014 04:35:32 +0000 (15:35 +1100)]
Use lazy logging interpolation
There are a small number of examples of "eager" interpolation in
neutron:
logging.debug("foo %s" % arg)
These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.
This change addresses all such current examples found in neutron core
via a pylint test. Vendor plugins and services are fixed elsewhere.
Assaf Muller [Sun, 21 Dec 2014 14:15:12 +0000 (16:15 +0200)]
Update L3 agent drivers singletons to look at new agent
L3 agent drivers are singletons. They're created once, and hold
self.l3_agent. During testing, the agent is tossed away and
re-built, but the drivers singletons are pointing at the old
agent, and its old configuration.
This is necessary because pbr is stupid enough not to be
able to handle symlinks. The initial symlink was necessary to
avoid breaking the functional job. Once change [1] merges we
can drop the old contrib directory.
Russell Bryant [Tue, 9 Dec 2014 17:30:53 +0000 (17:30 +0000)]
Scope dhcp rpc api using a messaging namespace
This patch updates the rpc API used by the DHCP agent to make calls
back into the neutron plugin to use the 'dhcp' namespace instead of
the default namespace. The reason is that this API is exposed over
the 'q-plugin' topic along with several other interfaces. Without the
use of namespaces, all of the interfaces are effectively treated as
one by oslo.messaging. When a namespace is used, the interface can be
versioned independently and when a method is called, the only class
considered for fulfilling the request is the one that claims to
implement the 'dhcp' namespace.
While we're here, add documentation to both the client and server side
of this interface that indicates where the other side is located.
Salvatore [Wed, 17 Dec 2014 22:09:24 +0000 (23:09 +0100)]
Remove NSX 'service' plugin
Following the spin-off for Neutron advanced services, this plugin
has become non-functional.
This patch removes the plugin, the service drivers, the database
models which kept tracking of resource associations, exceptions,
and obviously unit tests.
As there were some extensions which were leveraged only by this
plugin, they are being removed as well. In particular, one of
these extensions, 'routed-service-insertion' was in the
neutron.extensions package rather than neutron.plugins.vmware
package. This was for historical reasons. As no other plugin is
using this extension, it is being removed as well with this
patch.
By removing this plugin vmware the temporary skips applied to
neutron unit tests can be lifted. This patch does this.
Henry Gessau [Sun, 5 Oct 2014 05:23:50 +0000 (01:23 -0400)]
Move DB TestModelsMigrations from unit to functional
The tests to check that DB migrations and models are in sync depends
on the mysql and postgresql backends being available with a specific
DB user and database created. This violates the principles for unit
tests and therefore these tests should be moved to functional tests.
For these tests to work in the functional job in the gate, the
backends must be installed and the DB user and database created.
We do this via the functional gate hook.
Jakub Libosvar [Tue, 16 Dec 2014 16:33:23 +0000 (17:33 +0100)]
Backward compatibility for advanced services
Patch implements translation from class paths to neutron to class paths
to neutron_<adv_service>. It's achieved by defining entry point in
setup.cfg which is translated by stevedore.
There will be needed patches in advanced services tree calling
get_provider_driver_class() function before importing class.
This patch specifically fixes loading service plugins and
drivers for service plugin. Patches for agents are still needed in
neutron repo and adv services repos.
Alternative and better solution would be implementing new DriverType
to oslo.config, which will have callback to
get_provider_driver_class()-like function.
Alembic 0.7.1 contains checks of foreign keys so
method check_foreign_keys is not needed anymore.
Heal script should be updated to make it possible to use alembic
methods.
Assaf Muller [Sun, 23 Nov 2014 14:09:41 +0000 (16:09 +0200)]
Add metadata proxy L3 agent driver
To-Do:
* vArmourL3NATAgent (Before this patch) overrides _spawn/destroy_metadata_proxy
with empty stubs. This behavior should be maintained so that the metadata proxy
is not created when using vArmourL3NATAgent. It also overrides _router_added
and _router_removed, causing L3 agent driver notifications to not send out.
RobinWang [Tue, 9 Dec 2014 03:52:14 +0000 (11:52 +0800)]
Add OVS status and fix OVS crash
OVS crash/restart is unpredictable, so neutron-ovs-agent should be
robust enough under that situation. But currently ovs-agent doesn't
figure out this error status(only check ovs restart/normal status)
and still continue to apply subsequent operations(set br/add patch
port/...) till causing exceptions/crash. Add flag to fully represent
ovs status. Base on that, we can add proper fail-over code in method
rpc_loop, to treat ovs dead/restart gracefully to prevent agent
crashes while it is running.
Closes-bug: #1296202
Angus Lees [Wed, 17 Dec 2014 04:44:12 +0000 (15:44 +1100)]
Cisco: unsupported format character in log format
CiscoCfgAgent.hosting_devices_removed() contains an error in the
format string used to log errors:
LOG.error(_LE("Invalid payload format for received RPC message "
"`hosting_devices_removed`. Error is %{error}s. "
"Payload is %(payload)s"),
{'error': e, 'payload': payload})
"%{error}s" should be "%(error)s"
The existing version raises "ValueError: unsupported format character
'{' (0x7b)" when invoked.
rossella [Tue, 19 Aug 2014 17:41:16 +0000 (19:41 +0200)]
Remove locking from network and subnet delete op
delete_subnet in Ml2 plugin instead of using SELECT FOR
UPDATE deletes the IPAllocations that can be auto-deleted
straight away.
An exception is raised if there are ports that cannot be
autodeleted.
delete_network in ML2 plugin tries to delete all ports
and subnets before performing the network deletion.
No lock is needed here - if some other process modifies
the Port or Subnet table, adding new items, the network
deletion will fail because of a violation of a foreign
key contraint.
In that case the operation will be retried.
Avoid unnecessary explicit str() conversion around exceptions
There are number of places like
except Exception as exc:
LOG.error("Failed to get network: %s", str(exc))
where str() is not needed since %s substitution already does
the same conversion. Also LOG.error could be replaced with
LOG.exception, so argument exc won't be needed at all.