13117 Commits

Author SHA1 Message Date
Jenkins
60c1f99655 Merge "Kilo initial migration" 2016-01-08 03:45:27 +00:00
Kevin Benton
447f4b1461 Move notifications before DB retry decorator
This patch moves the start notifications emitted in the API
layer ('network.create.start', etc) to before the DB retry
decorator. This prevents benign retry events from resending
notifications onto the message bus.

Change-Id: I8159692a107ede397a4abeff71310a99fffa4862
Closes-Bug: #1532051
2016-01-07 17:30:58 -08:00
Carl Baldwin
6a350bf950 Create a routing table manager
The routing table manager maps address scope ids to routing tables.
It uses the rt_tables file specific to each namespace to maintain the
mapping so that id can simply be used as the table name when running
iproute2 commands.  This will be useful when debugging.

Change-Id: Icd5e98c82a070045a50e0c5d3762906b7e159d3d
Partially-Implements:  blueprint address-scopes
2016-01-08 00:36:34 +00:00
Shih-Hao Li
5bd76c5284 Fix uuid passing in disable_isolated_metadata_proxy
In DhcpAgent, when enable_isolated_metadata_proxy() spawns
a metadata proxy agent for a network, it will pass router_id
instead of network_id if metadata network is enabled and
a router port is connected to this network.

Later, MetadataDriver will register this uuid (i.e. router_id)
with monitor for the new metadata proxy process.

But when disable_isolated_metadata_proxy() destroys a metadata
proxy agent for a network, it always passes network_id as the uuid.
Thus MetadataDriver can not find the matching process. So the
corresponding metadata proxy agent can not be destroyed.

Closes-bug: #1526084
Change-Id: Icab94f4e09e95fa6729c458522a3fe50e850a4be
2016-01-08 00:25:27 +00:00
Brian Haley
ddfa00fec0 Fix incorrect classmethod declaration
pylint complains about this:

************* Module neutron.tests.api.base
C:207, 4: Class method _try_delete_resource should have 'cls' as
first argument (bad-classmethod-argument)

Change-Id: I189c54a2c641b97579761ff37c8f87077037697b
2016-01-07 15:12:24 -05:00
Anand Shanmugam
75dcd5f2ec Add unit test cases for linuxbridge agent when prevent_arp_spoofing is True
Currently there is no test coverage for when prevent_arp_spoofing is set to true.
This fix address that issue.

Change-Id: Ie8bfa873120378dcdcb9d43e307daa5d55c038f2
Closes-Bug: #1520255
2016-01-07 09:21:32 -08:00
Ihar Hrachyshka
7a2824afc4 Adopt oslotest BaseTestCase as a base class for DietTestCase
This will make us more in line with other projects in terms of testing
API. It also allows to remove some duplicate code from base test classes
for Neutron, leaving just Neutron specific fixture setup there.

Note: we don't add a new dependency because the library is already used
in some of database functional tests through oslo.db base test classes.

Change-Id: Ifec6cce386d8b024605496026c8469200f3c002b
Closes-Bug: #1531484
2016-01-07 15:08:54 +01:00
caoyue
af0fca6ad3 Use oslo.utils.reflection extract the class name
The oslo.utils reflection module/code handles more variations of
where a class name may come from (on python 2 and python 3) so its
usage allows getting more accurate class names so we might as well use it.

Change-Id: I8e9bb4a8e517111eee80a60c518f29c8d87490e9
2016-01-07 19:44:59 +08:00
Gary Kotton
0bd2b816a0 Utils: Add missing translation to exception
Add a missing translation.

TrivialFix

Change-Id: I2a87704ea12800c377659d59b2ad623fcaf0c802
2016-01-07 03:29:52 -08:00
lzklibj
3491cbc0c5 Unify assertEqual for empty usages
Update previous assertEqual(observed, *empty) usages to
assertEqual(*empty*, observed).

This patch aslo update hacking check for assertEqual with
empty types.

Change-Id: I981277618f92254a5beb9d3308a317d8c14e125c
2016-01-07 10:06:35 +00:00
Moshe Levi
d760416998 SR-IOV: Fix macvtap assigned vf check when kernel < 3.13
when creating macvtap passthrough to SR-IOV VF in Kernel >= 3.13 an
upper_macvtap symbolic link is created. For Kernel < 3.13 the only
way to know it is by parsing the ip link show output and look for
macvtap[0-9]+@<vf ifname>.

This patch used the ip link show command to detects
macvtap assigned vf so that detection of macvtap assigned vf
will work on all kernels

Closes-Bug: #1523083
Change-Id: Icbc8d6af5c00d1453095e04dd779210dc7244c7f
2016-01-07 09:38:39 +01:00
Jenkins
3bcc1c3d4c Merge "Separate the command for replace_port to delete and add" 2016-01-07 04:50:56 +00:00
Jenkins
dec01b8583 Merge "ovs_vhostuser: fix vhostuser_socket_dir typo" 2016-01-07 01:37:36 +00:00
Jenkins
5b0c20ebe4 Merge "Remove openstack.common._i18n from Neutron" 2016-01-07 01:37:12 +00:00
Carl Baldwin
bf2f1f1f87 Remove references to model_base through models_v2
I saw a patch set [1] that was running in to circular imports and
removing these.  I thought it'd be better to remove them all in one
shot.

[1] https://review.openstack.org/#/c/261222/1/neutron/db/agents_db.py

Change-Id: If1a9ba3091ac99f01f73b98a7459358c3efd4dd5
2016-01-06 16:12:29 -07:00
Kevin Benton
8e54248653 Allow get_unused_ip method to skip v6 and fix iter
Skip IPv6 subnets when looking for an unused IP in the
floating IP tests since floating IPs cannot be requested
with v6 addresses.

This also fixes the iterator for the non-allocation pool
case.

Closes-Bug: #1531706
Change-Id: Id0b2c28970ab61e45755818e3e0798daa4453ce7
2016-01-06 13:27:54 -08:00
Jenkins
ecc108caa8 Merge "Revert "Revert "Revert "Remove TEMPEST_CONFIG_DIR in the api tox env"""" 2016-01-06 20:48:14 +00:00
Jenkins
bf11ed7430 Merge "Introduce an API test for specified floating ip address" 2016-01-06 20:45:05 +00:00
Jenkins
dc0706b534 Merge "Don't snat traffic between fixed IPs behind same router" 2016-01-06 20:44:40 +00:00
Jenkins
37a9594aa4 Merge "Remove l2pop _get_port_infos method" 2016-01-06 20:44:19 +00:00
Jenkins
8dc59c82b3 Merge "Fix meter label rule creation" 2016-01-06 20:44:00 +00:00
Jenkins
9c5a25b141 Merge "SR-IOV agent: display loaded extensions" 2016-01-06 20:43:11 +00:00
Jenkins
02d7e99d90 Merge "Imported Translations from Zanata" 2016-01-06 20:40:39 +00:00
Ihar Hrachyshka
380e384f18 Revert "Revert "Revert "Remove TEMPEST_CONFIG_DIR in the api tox env"""
This reverts commit be63289c273fa02159a6958e0b456d5fda217431.

Yes, it's a third order revert. Ain't it cool?

Now that tox 2.3.1 is used in gate, and it is expected to fix the issue
that we originally hacked around here, let's revert to the previous
code.

For the least, it makes API target executable locally without the need
to set TEMPEST_CONFIG_DIR in the external environment.

Also bump minimal tox version to 2.3 to avoid users hitting the old
issue with their tox 2.2.* package.

Change-Id: Ic64cb466d117ad39436cb1d079c8f5657260da2c
Related-Bug: #1515335
2016-01-06 16:14:26 +00:00
Jenkins
25a9f6eec3 Merge "Add extension_manager and support for extensions in linuxbridge agent" 2016-01-06 15:12:58 +00:00
Yu Fukuyama
6659a93558 Fix meter label rule creation
In the case of outbound traffic, set remote_ip to dst.
In the case of inbound traffic, set remote_ip to src.

Change-Id: I7f27b93efa67baf3efccaa94f6a1337d6886e230
Closes-Bug: #1528137
DocImpact: Clarify remote_ip_prefix description of metering label rule in API site
2016-01-06 14:08:07 +00:00
Jenkins
89fa5b997a Merge "Add test for Neutron object versions" 2016-01-06 13:35:44 +00:00
Assaf Muller
494ee39c6f Remove l2pop _get_port_infos method
It's a method called 'get_port_infos' that returned
4 values, most of which were not a function of the port.
What the method did or its naming was very unclear to me
so I broke it up according to its usage.

Change-Id: Ib1fd589e9123fc5009f0887dd400c550efa687a3
2016-01-06 13:17:36 +00:00
Assaf Muller
251847bfcd Remove L2populationDbMixin parent
Change-Id: I429f5dcd2327dacf9cc6eb7754696bd4bdc8ea1f
2016-01-06 13:17:20 +00:00
Ihar Hrachyshka
e58a0e5062 devstack: don't enable qos service with the plugin
Require explicit enablement for the service. Enable the service in API
gate job because we have API tests for the service.

Change-Id: Ibdd41eb761b64499a992f49ac0159167c7fb7d79
2016-01-06 12:34:35 +01:00
Jenkins
70606fa29a Merge "Some minor misspellings in comment block." 2016-01-06 10:56:17 +00:00
Martin Hickey
074268f74c Add test for Neutron object versions
Adds a test to Neutron to check object versions for any changes
to objects. It prompts the developer to update the version of the
changed object. It uses oslo.versionedobjects.

Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b
Co-Authored-By: Ryan Rossiter <rlrossit@us.ibm.com>
2016-01-06 10:34:03 +00:00
Moshe Levi
66a91c6c38 SR-IOV agent: display loaded extensions
The SR-IOV agent support l2 agent extension due to
this patch https://review.openstack.org/#/c/210483/

This patch allow to show the loaded l2 agent extensions
when executing neutron agent-show <SR-IOV agent id>

Closes-Bug: #1527307
DocImpact update the agent configuration to show
          l2 agent extensions
Change-Id: I5dcb79ef539e4f18693e4a8eff03fff40873d3fa
2016-01-06 10:45:09 +02:00
OpenStack Proposal Bot
35cd834c37 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Icca45cc80c0481a7bc500b8409aaa0948ba5daa2
2016-01-06 06:29:46 +00:00
Jenkins
b01e3084d1 Merge "Delete test_restart_l3_agent_on_sighup" 2016-01-06 04:11:05 +00:00
gong yong sheng
240facf9e6 Allow tox to pass more arguments to ostestr command
Co-Authored-By: Kevin Benton <blak111@gmail.com>
Change-Id: Ie9969e0a5254ab5dd33b287f6d3120362b73edd7
Closes-bug: #1490389
2016-01-05 14:53:19 -08:00
Brent Eagles
398d10e323 Add systemd notification after reporting initial state
This patch adds a notification for systemd after the agent has reported
its initial state to the Neutron server. This enables configuring
orderly startup of services that are dependent on the server having a
healthy openvswitch agent running.

Related-Bug: #1525901

Change-Id: I8d08f1b2ae196b1e48f9d91e06966687c0a8bd43
2016-01-05 17:13:52 -03:30
Mathieu Rohon
5d53dfb8d6 Avoid duplicating tenant check when creating resources
The check of the tenant done in the method _get_tenant_id_for_create()
is already did by the Neutron Controller in prepare_request_body(),
with a call to attributes.populate_tenant_id().
Moreover, when the Controller processes a "create" requests, it
will add the 'tenant_id' to the resource dict.
Thus, _get_tenant_id_for_create() can be deleted.
Calls to this method are replaced by the res['tenant_id'].

Changes have to be done in UT to explicitly add the tenant_id while
creating resources, since the UT framework is bypassing the controller code
that automatically adds the tenant_id to the resource.

Co-Authored-By: Hong Hui Xiao <xiaohhui@cn.ibm.com>
Closes-Bug: #1513825
Change-Id: Icea06dc81344e1120bdf986a97a6b1094bbb765e
Depends-On: I31022e9230fc5404c6a94edabbb08d2b079c3a09
Depends-On: Iea3f014ef17a1e1b755cd2efe99afd1a36ebbc6a
Depends-On: I604602d023e0cbf7f6591149f914d73217d7a574
2016-01-05 14:18:41 +00:00
Sławek Kapłoński
23e0e29a2b Add extension_manager and support for extensions in linuxbridge agent
There is extensions mechanism for l2 agents already but it was
implemented only for openvswitch l2 agent. This patch adds support for
such extensions also for linuxbridge agent.

This patch also adds support for network_update events received by the
agent via RPC. It is required because sometimes when a network is
updated (for example with a QoS policy is attached to it) all ports that
belong to the network should also be updated.

Change-Id: Ie81c818d0eb817b044a6df1cbddc5864f118fe3f
Partial-bug: 1468803
2016-01-05 12:38:11 +00:00
Assaf Muller
218b5d06f5 Fix API tests
Patch https://review.openstack.org/#/c/256164/
broke the Neutron API job by unsetting Tempest configuration
values that were unused by Tempest, but used by Neutron's fork
of Tempest. This patch copies credentials from the 'auth' section
to the 'identity' section.

The longer term plan is detailed here:
https://etherpad.openstack.org/p/neutron-tempest-defork
TL;DR: Removed overlap of tests between the Tempest and Neutron
repos, then use Tempest's plugin architecture for the tests that
will remain in the Neutron repo.

Change-Id: Ieb396cfd17f9cb66776ead11e7f760c1c26a0b08
2016-01-05 10:41:44 +00:00
Swaminathan Vasudevan
80ede80ade DVR: Rename dvr_update_router_addvm function
Since dvr routers have to be scheduled and updated for
all dvr service ports other than vms, it is better to
rename the function appropriately.

Change-Id: I4e3d58bb9a01798cc808ac1e77584153a29a89e3
2016-01-05 04:45:54 +00:00
rossella
0d5d014955 Support rootwrap sysctl and conntrack commands for non-l3 nodes
Iptables-firewall use commands sysctl and conntrack.
These are missed out in the plugins resulting in (No filter matched) errors in
non-l3 nodes. L3 nodes do not have this problem as l3.filters rootwraps these
commands.

Closes-bug: #1528641

Change-Id: I1167544a41f2ea91781ae2bb7aa208e25fec1524
2016-01-04 20:05:10 +00:00
houming-wang
93aeb99b79 Remove openstack.common._i18n from Neutron
Since oslo-incubator is no longer maintained[1] after
90ae25e38915cc502d9e9c52d59e8fb668a72ae1. And
openstack/common/_i18n.py is not referenced by Neutron. Let's remove it.

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/
    079343.html

Change-Id: Ia81d30d9722a5cc7d6ad21b0cbb27df8cd80c848
2016-01-04 17:58:46 +00:00
Ann Kamyshnikova
ceb9c40d66 Kilo initial migration
Juno will be deprecated with Mitaka release, so juno_initial migration
should be replaced with kilo_initilal migration in Mitaka.

Optimized execution time of "upgrade head" command.
Test on my local machine on MySQL shows about 28% reduce (from 188
seconds to 137 seconds).

Related-Bug: #1501380

Change-Id: I26571f1c43764a01d1ae9869ce43ff18ea677892
2016-01-04 16:50:09 +00:00
Dongcan Ye
34d4a6a78b Check missed ip6tables utility
In some scenario, like in OpenStack Kolla, system may lack
iptables-ipv6 package. This may cause command ip6tables-save
or ip6tables-restore invalid and ovs-agent error.

This patch allows checking ip6tables support from CLI:
    neutron-sanity-check --ip6tables_installed

Or using configuration options, for example:
    neutron-sanity-check --config-file /etc/neutron/neutron.conf
    --config-file /etc/neutron/plugins/ml2/ml2_conf.ini

Change-Id: Ia6cf1ed6b5033442f03eac61d2d0d783c146d797
Closes-Bug: #1530042
2016-01-04 19:19:56 +08:00
Swapnil Kulkarni (coolsvap)
6689724f0e Keep py3.X compatibility for urllib
Change-Id: I463d00865b8f384d22798be4dd86b62f821af67c
Partial-Bug:#1280105
2016-01-04 15:17:05 +05:30
Jenkins
0c07378509 Merge "dhcp: Default to using local DNS resolution" 2016-01-03 13:34:31 +00:00
OpenStack Proposal Bot
95414bcfd4 Updated from global requirements
Change-Id: I721b27b36b21447161a34a6cf6788eac6dd145fc
2016-01-01 20:29:56 +00:00
Jenkins
e3468ed8a2 Merge "Misspelling in message" 2015-12-31 11:50:13 +00:00
Herman Ge
42e51bf06f Misspelling in message
Misspelling in following message:
"# interconnect physical and integration bridges using veth/patchs".
Should be:
"# interconnect physical and integration bridges using veth/patches".
Totally 1 occurrence in Neutron base code.

Change-Id: If752b8c65cf4993447b93dfc9a06de15389f2675
2015-12-31 09:08:18 -05:00