20217 Commits

Author SHA1 Message Date
Akihiro Motoki
7a714aeb13 Fix pep8 errors
Recent pep8 upgrade and corresponding pycodestyle update break
pep8 job due to the new rules.

This commit fixes the following new errors:
- E266 too many leading '#' for block comment
- E501 line too long
- H903  Windows style line endings not allowed in code

The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- E731 do not assign a lambda expression, use a def
- W503 line break before binary operator

Change-Id: I1fd3357479bb2ba3d89de92739ffac99900761b6
2018-04-11 01:10:49 +09:00
Zuul
db8ecdd125 Merge "DVR: Restarting l3 agent loses centralized fip ip on qg-interface" 2018-04-09 23:03:56 +00:00
Zuul
c9f03df891 Merge "Router should flip to standby if all L3 nodes down" 2018-04-09 22:45:52 +00:00
Zuul
ff132d69ce Merge "Fix incompatible requirement in lower-constraints" 2018-04-09 22:45:45 +00:00
Zuul
ffef5c0d01 Merge "DVR: Avoid address scope rules for dvr_no_external agents" 2018-04-09 21:30:07 +00:00
Zuul
582c1415cb Merge "Handle AgentNotFoundByTypeHost exception properly" 2018-04-09 20:57:07 +00:00
Zuul
b5be06dfa5 Merge "tests: fixed NoSuchGroupError in TestNovaSegmentNotifier" 2018-04-09 20:30:14 +00:00
Nguyen Hai
11f1439bdf Fix incompatible requirement in lower-constraints
Fix lower-constraints don't match the lower bounds
in the requirements file(s). It may cause fail in
requirements-check.

REF:
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129056.html

Change-Id: Ib837a7f8d257f116845d483cd63bf362f10725d1
2018-04-07 11:15:47 +09:00
Zuul
1ce070c8e2 Merge "Refresh router objects after port binding" 2018-04-06 22:34:55 +00:00
Zuul
a2c1d336b9 Merge "SR-IOV agent should specify host when requesting devices info" 2018-04-06 22:33:08 +00:00
Ihar Hrachyshka
eb28af9f09 tests: fixed NoSuchGroupError in TestNovaSegmentNotifier
The tests are failing when executed separately with -m testtools.run
because they rely on another test class to register ml2 and ml2_vlan
option sections.

TrivialFix

Change-Id: I7a9a5c7c7f62783aceccd9e6ea62aacd9753d0d4
2018-04-06 11:28:33 -07:00
Swaminathan Vasudevan
64028a389f DVR: Restarting l3 agent loses centralized fip ip on qg-interface
When l3 agent is restarted on a dvr_snat node that is configured
for L3_HA and has a centralized FloatingIP configured to the
qg-interface in the snat_namespace, that FloatingIP is not
re-configured to the qg-interface when agent starts.

The reason being, the cidr is not being retrieved from the
keepalived instance and only retrieved from the
centralized_fip_cidr_set.

If 'L3_HA' is configured we need to retrieve it from the keepalived
instance.

This patch fixes the problem by retrieving the cidrs from the
keepalived instance for the qg-interface.

Change-Id: I848a20d06e2d344503a4cb1776dbe2617d91bc41
Closes-Bug: #1740450
2018-04-06 09:31:42 -04:00
Zuul
9b316ccdf5 Merge "DVR: Check for item_allocator key before releasing" 2018-04-05 21:50:01 +00:00
Zuul
97232c1045 Merge "Use cidr during tenant network rule deletion" 2018-04-05 19:09:05 +00:00
Zuul
1fc826411a Merge "DVR: Add error handling for get_network_info_for_id rpc call" 2018-04-05 16:30:48 +00:00
Zuul
221fdd7976 Merge "Removing deprecated function 'IPWrapper.get_namespaces()'" 2018-04-05 16:30:40 +00:00
Swaminathan Vasudevan
7c4da6fb75 DVR: Avoid address scope rules for dvr_no_external agents
All FloatingIP for DVR_NO_EXTERNAL agents will be configured
in the SNAT Namespace. So there is no need to configure the
address scope related routes in the router namespace when the
agent is configured as DVR_NO_EXTERNAL.

Change-Id: I009dae9e7f485641f2f19dce8dd575da04bfb044
Related-Bug: #1753434
2018-04-05 08:37:08 -07:00
Dmitrii Shcherbakov
ff5e8d7d6c Refresh router objects after port binding
Post-binding information about router ports is missing in results of RPC
calls made by l3 agents. sync_routers code ensures that bindings are
present, however, it does not refresh router objects before returning
them - for RPC clients ports remain unbound before the next sync and
there is no necessary address scope information present to create routes
from fip namespaces to qrouter namespaces.

Change-Id: Ia135f0ed7ca99887d5208fa78fe4df1ff6412c26
Closes-Bug: #1759971
2018-04-05 11:05:53 -04:00
Sławek Kapłoński
7b0f6330d6 Handle AgentNotFoundByTypeHost exception properly
During listing router_ids on host it is possible that on some hosts
there are no L3 agents.
In such case AgentNotFoundByTypeHost exception is raised in
neutron.db.agents_db module in _get_agent_by_type_and_host() method.
Now this exception is properly handled during listing routers on host.

Change-Id: Ia5ff1b57ef63c98b4ada4f2d46c45336e413be3d
Closes-Bug: #1737917
2018-04-05 11:16:45 +00:00
Drew Thorstensen
b62d1bfdf7 Router should flip to standby if all L3 nodes down
A HA router should always be active unless all of the agents hosting
that router go down.  In that event, the router should switch to
standby.  This behavior changed with review:
  https://review.openstack.org/#/c/411784

That review seemed to be accounting for a flakey message bus.  This
change should account for that, but also revert to the original behavior
of the router state only changing when its backing agent hosts are down.

Change-Id: I89c3b2546382624f175f8de4de621c3e53adf527
Closes-Bug: 1682145
2018-04-04 23:43:00 +00:00
Swaminathan Vasudevan
ed7dd4dae0 DVR: Check for item_allocator key before releasing
item_allocator class maintains the allocation of
items(link local address) from a given pool.
There may be cases where the key has been already
released or not being remembered while trying to
release it.
So it makes sense to lookup for the key before
releasing the key.

Change-Id: I34765dd3efa6c6742caeb7f6ae2ff14009dce6dd
Closes-Bug: #1761260
2018-04-04 11:47:41 -07:00
Zuul
09e053cd91 Merge "use neutron-lib servicetype api def" 2018-04-04 17:11:52 +00:00
Zuul
60bb352fe2 Merge "use multiprovidernet api definition from neutron-lib" 2018-04-04 17:11:46 +00:00
Zuul
a64d3c2980 Merge "[doc][vpnaas] Fix reference url after recent change" 2018-04-04 15:26:41 +00:00
Zuul
4982507dbb Merge "Fix DHCP isolated subnets with routed networks" 2018-04-04 04:46:22 +00:00
Cao Xuan Hoang
91068d097e [doc][vpnaas] Fix reference url after recent change
This patch intends to fix the reference URL after the recent change
in vpnaas [1]

[1] https://review.openstack.org/#/c/555167/

Change-Id: Icfec7fe3329c545d2f60c6e6cb7c28d4c05d6f36
2018-04-04 09:35:55 +07:00
Dmitrii Shcherbakov
81db328b2d Use cidr during tenant network rule deletion
If a distributed router has interfaces on multiple tenant networks, with
'fast exit' functionality policy based rules are created in qrouter
namespace for every tenant network subnet and 'from <cidr>' is included
into an 'ip rule' command invocation.

When a port on a tenant network is deleted 'from <cidr>' part is not
included and a first rule matching specified parameters gets deleted.

For example with the following layout

ip netns exec qrouter-4f9ca9ef-303b-4082-abbc-e50782d9b800 ip rule
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
80000:  from 192.168.100.0/24 lookup 16
80000:  from 192.168.200.0/24 lookup 16

and neutron l3 agent will use this command

ip netns exec qrouter-4f9ca9ef-303b-4082-abbc-e50782d9b800 ip -4 rule\
del priority 80000 table 16 type unicast

and 192.168.100.0/24 rule will get deleted even if you actually removed
a port on 192.168.200.0.

This results in an extra rule present and not cleaned up and the right
rule removed. It is only recreated if a router is disabled and enabled
again.

additional changes:

1) Floating IP rules are identified by priority only as implemented
currently - for this reason this change adds fixed_ip to the rule
removal code. Rule priorities are 32-bit values in iproute2 so,
in theory, those should be not be used to cover IPv6.

2) IP protocol information for 'from all' rules is currently
derived from link-local address IP version. The same approach
is preserved by using version-specific /0 addresses without
changing the API provided by ip_lib.

Change-Id: I0ea6dddd26e17771be223a1fbdf21792c90f3e9c
Closes-Bug: #1759956
2018-04-03 19:17:03 -04:00
Vu Cong Tuan
28f7ab01a6 Removing deprecated function 'IPWrapper.get_namespaces()'
'IPWrapper.get_namespaces()' is deprecated in version 'Queens'
and was marked to be removed 'Rocky'.
This patch removes it and switches to use
'neutron.agent.linux.ip_lib.list_network_namespaces' instead.

Change-Id: I090cc5841aca5b638d08d65645162811950d6437
Depends-On: Id629481fd722004a7b7d827bf6209785f85f4c64
2018-04-03 19:52:52 +00:00
Zuul
b6a984003d Merge "Have LB agent use ip_lib.ensure_device_is_ready()" 2018-04-03 01:47:49 +00:00
Miguel Lavalle
bb5138cff4 Fix DHCP isolated subnets with routed networks
After the merge of [1], the DHCP agent will fail to configure a routed
network when attempting to generate host routes for a non-local subnet
that is also isolated from the point of view of the metadata service.
This patch adds a check to make sure that the host route is not added
for non-local subnets.

[1] https://review.openstack.org/#/c/468744

Change-Id: Ia03f538a7d2d10d600d9359da5b3a74532709d1f
Closes-Bug: #1758952
2018-03-31 17:55:35 -05:00
Swaminathan Vasudevan
c331b898e1 DVR: Add error handling for get_network_info_for_id rpc call
Add error handling for get_network_info_for_id rpc call in the
ovs_dvr_neutron_agent.

Closes-Bug: #1758093
Change-Id: I44a5911554c712c89cdc8901cbc7b844c4b0a363
2018-03-30 10:52:18 -07:00
Zuul
44be070a3e Merge "Add iptables metadata marking rule on router init" 2018-03-28 21:57:36 +00:00
Zuul
d12e53b2e0 Merge "Switch ip link command to pyroute2" 2018-03-28 21:17:47 +00:00
Zuul
0610aa1815 Merge "Enable mutable config in Neutron" 2018-03-28 20:57:08 +00:00
Zuul
82abf86207 Merge "Removing deprecated module neutron.api.versions" 2018-03-28 20:57:01 +00:00
Zuul
633fb59dca Merge "Add fullstack job to gate queue" 2018-03-28 20:56:34 +00:00
Zuul
d6307dd1dc Merge "Don't define polling_interval option in two places" 2018-03-28 20:56:27 +00:00
Boden R
b78d47927e use multiprovidernet api definition from neutron-lib
The multiprovidernet API extension's definition was rehomed into
neutron-lib with commit If3367e6a14074a6225bba527e8f7e38c51280f85
This patch consumes it by:
- Using the APIExtensionDescriptor and API definition for the extension.
- Removing the rehomed (now duplicated) code from neutron.
- Using lib's code were applicable.

NeutronLibImpact

Change-Id: I12c15c360f8bf5a45fbe70e5ed1202ef0e7ec0f0
2018-03-28 07:07:58 -06:00
Zuul
93851ee6ff Merge "Fix l3-agent crash on routers without ha_state" 2018-03-28 12:25:25 +00:00
Sławek Kapłoński
1b6e374808 Add fullstack job to gate queue
Fullstack job's failure rate is reasonable since few weeks,
job is already working as "voting" and there is no problem
with that.
Because of that it is now added also to gate queue.

Change-Id: I346c3c97b26932e2f02893cf5f3b63090cd81ee0
2018-03-28 11:09:29 +02:00
Vu Cong Tuan
7988e32202 Removing deprecated module neutron.api.versions
'Versions.factory()' is deprecated in version 'Queens'
and was marked to be removed 'Rocky'.
This patch removes it and switches to use
neutron.pecan_wsgi.app.versions_factory instead.

In addition, neutron.api.versions is removed
because this deprecated module isn't used anywhere.

Change-Id: I08d1725a973c734b55771918915428377fb7d3b4
2018-03-28 14:15:50 +07:00
Zuul
c3f2b89601 Merge "[Functional] Add test for ip_lib.IPRule lifecycle" 2018-03-28 01:24:55 +00:00
Zuul
53b3e76f61 Merge "Catch Errors When Nova API Microversions Are Not Supported" 2018-03-27 23:14:49 +00:00
Boden R
925cdc992d use neutron-lib servicetype api def
The service type extension's API definition was rehomed into neutron-lib
with commit I301f74d09eb4c0f1d8a0e065403da59e222b78e3

This patch consumes it by removing the rehomed code in neutron and using
the def from neutron-lib.

NeutronLibImpact

Change-Id: I30659530c557426fbf4da6cc60892345f3be006e
2018-03-27 14:32:44 -06:00
Ihar Hrachyshka
a1b49c796e Don't define polling_interval option in two places
The option is currently defined in two places - as a generic agent
option and as a sriov agent specific one. This is a problem now that
oslo.config tracks location where options are defined
(I6dec1e09dcab203c6287f9c56c866f220a42f850) because when unit test
runner imports all modules, it registers the option from those two
separate locations, and since locations are different, it's considered
the options are duplicate, which results in the following error:

DuplicateOptError: duplicate option: polling_interval

To fix the issue, I removed the definition of the option from sriov
module and made sure the common agent options are registered whenever
the sriov module is imported.

Change-Id: I485532692f4b3a5804885e0325a8352fe6b1aa65
Closes-Bug: #1759345
2018-03-27 11:38:39 -07:00
Zuul
62d0d75229 Merge "[Functional tests] Add gateway add/delete/flush tests" 2018-03-27 15:24:29 +00:00
Ryan Bridges
0f4d7ff527 Catch Errors When Nova API Microversions Are Not Supported
Currently, errors related to lack of microversion support are completely
masked because of the way eventlet.spawn_n() works. These changes
improve error handling so that deployers are explicitly notified when
Nova API microversions are not supported. This is useful because without
microversion support, the entire flow will break and hosts will not be
associated with segments properly. Deployers will have no idea why
because errors are not printed to log files setup by the standard Python
logging framework.

Related-Bug: #1759004
Change-Id: I9c6151ffa90394612e7f81ededd4a309dd8ab7fb
2018-03-27 08:11:54 -07:00
Zuul
5f306a8b24 Merge "Removing remaining Tempest bits" 2018-03-27 08:27:51 +00:00
Sławek Kapłoński
94817a5a5d [Functional] Add test for ip_lib.IPRule lifecycle
This patch adds functional test for basic create/list/delete of
routing policy rules.

Change-Id: I3a9447bb89642269c370ea6dbf8bf9166bde2ca1
2018-03-27 10:26:43 +02:00
Zuul
51e6a66780 Merge "[Docs] Update path to QoS API tempest tests" 2018-03-26 22:53:20 +00:00