20955 Commits

Author SHA1 Message Date
Zuul
8c05cd31ef Merge "Fix flake8 H404 errors" 2018-10-09 07:00:33 +00:00
Zuul
f719d1f087 Merge "Remove population of is_filter keyword" 2018-10-06 15:33:56 +00:00
Zuul
5fc8bb59c5 Merge "fix tox python3 overrides" 2018-10-05 23:55:55 +00:00
Zuul
1663414a6b Merge "use payloads for AGENT BEFORE_DELETE callbacks" 2018-10-05 23:55:52 +00:00
Brian Haley
2b57f08576 Fix flake8 H404 errors
Fix H404 error and start enforcing it.

Trivialfix

Change-Id: Iaa6fb4f1f07dee32a944259ab65204360d9db7ea
2018-10-05 21:48:41 +00:00
Zuul
3e579256a3 Merge "Upgrade pylint to a version that works with python3" 2018-10-05 17:14:15 +00:00
Zuul
41f6560dd6 Merge "Update tests neutron.conf to use transport_url" 2018-10-05 15:01:07 +00:00
Zuul
688914a247 Merge "Add argument to get ports by SG to allow excluding owners" 2018-10-05 06:11:34 +00:00
Zuul
5e104965a3 Merge "remove trailing comma for linter" 2018-10-05 00:53:46 +00:00
Zuul
22e8228dd4 Merge "Fix best_match() deprecation warning" 2018-10-04 23:33:23 +00:00
Doug Hellmann
1307cb7587 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I9530cd2433e0e34f05667d33bd6469b2592f8738
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 18:04:02 +00:00
Doug Hellmann
2530ccff8f Upgrade pylint to a version that works with python3
Also fixed some six.moves errors as well.

Change-Id: I9783ee588de1ec4b91a665b9dc89fdba3e2d90df
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 18:03:25 +00:00
Zuul
8056f2b386 Merge "Optimize OVS DVR CSNAT port code a little" 2018-10-04 16:52:33 +00:00
Zuul
875c55a66a Merge "Fix corner case in failure assigning MAC to SR-IOV NIC" 2018-10-04 16:52:30 +00:00
Doug Hellmann
ebfed6090b remove trailing comma for linter
The linter sees the trailing comma after the function call as building
a tuple without wrapping it in parens. That doesn't seem to be the
intent (it looks like a typo), so remove the comma.

Change-Id: Ie3e051c43d68d09716fc0a4506ed111908730280
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 13:11:08 +00:00
Zuul
c4b16aa492 Merge "Add openstack/placement as a required project for neutron-grenade*" 2018-10-04 12:58:36 +00:00
Zuul
d8b09c576e Merge "Fix pep8 F402 import shadowing" 2018-10-04 12:58:34 +00:00
Bernard Cafarelli
d82a5d3c14
Update tests neutron.conf to use transport_url
The deprecated rpc_backend parameter was removed from oslo.messaging in
I193cc0e613459a6dbbfd54ed0901a54ded78d712

Use transport_url parameter instead

Change-Id: Ia73fe052986617dd6ce5e68cced0c4c88516a33e
Closes-Bug: #1795878
2018-10-04 11:39:23 +02:00
Zuul
26e6f961f9 Merge "Refactor l3hamode for ha migration." 2018-10-04 06:20:15 +00:00
Zuul
6eef68e384 Merge "Always set ovs bridge name in vif:binding-details" 2018-10-04 06:13:37 +00:00
Zuul
d58a5bc044 Merge "Disable some pylint checks" 2018-10-04 05:29:08 +00:00
Zuul
615705b2bd Merge "Update code review policies for sub-projects." 2018-10-03 22:39:51 +00:00
Zuul
2f421ecdd0 Merge "bump neutron-lib version to 1.19.0" 2018-10-03 22:05:54 +00:00
Nate Johnston
f721c3dcc7 Add argument to get ports by SG to allow excluding owners
When code needs to load a list of all ports that are not router
interfaces, they tend to fetch the port information into memory and then
iterate over the ports, inspecting each port's device_owner.  For large
numbers of ports this is presumably inefficient.  This came up in a
discussion of just such a part in the code [1].

A more efficient solution is to perform this filtering in SQL.  This
change adds an argument to an existing method in the Port object to do
that.

[1] https://review.openstack.org/580721

Change-Id: I742d8a79175209e42f8bd6319956e960c73201ee
2018-10-03 20:05:16 +00:00
Brian Haley
ed225d3f57 Optimize OVS DVR CSNAT port code a little
Change _bind_centralized_snat_port_on_dvr_subnet() to pull
the subnet uuid out of the fixed IP earlier, since that
is all it is passing in its remote RPC call.

Trivialfix

Change-Id: I9686fd619214a3c33af253af5ad69e9f406c7e18
2018-10-03 19:51:10 +00:00
Brian Haley
eea5aaac4f Fix corner case in failure assigning MAC to SR-IOV NIC
Sometimes due to NIC driver incorrect behavior, VFs might be
missing in 'ip link show' output.  This may lead to a VM boot
failure as agent will just skip such missing devices.

Make the agent do a resync in case a newly added device
'disappears' during processing, which should cause a MAC to
get assigned.

Co-authored-by: Oleg Bondarev <obondarev@mirantis.com>

Change-Id: I148b5a025fc388821fd1269d02908cc8ce1882fe
Closes-bug: #1784484
2018-10-03 19:32:12 +00:00
Brian Haley
bc4f93c232 Fix best_match() deprecation warning
wsgi call to best_match() generates the following warning:

DeprecationWarning: The behavior of AcceptValidHeader.best_match
is currently being maintained for backward compatibility, but it
will be deprecated in the future, as it does not conform to the RFC.

Change to use acceptable_offers() as was done in nova code.

Simlar changes in the wsgi best language code as well, except
new call is to lookup().

Required bump to get WebOb 1.8.2.

Trivialfix

Change-Id: I45a222c098658eef6a49adcc168b0f5625ea49db
2018-10-03 19:30:40 +00:00
Zuul
6a767c2954 Merge "Remove a bare raise noticed by the linter" 2018-10-03 19:20:29 +00:00
Zuul
0678e48b6b Merge "Create temp file in setUp() to avoid warning" 2018-10-03 19:00:54 +00:00
Miguel Lavalle
9a103c3c2a Update code review policies for sub-projects.
As agreed during the Stein PTG, this patch proposes an update to the
code review policies, aimed at minimizing the impact of code changes in
Neutron on the Stadium and other networking related projects.

Change-Id: I455a62daa9115962cd6347d1f3966dae533e4abb
2018-10-03 10:58:33 -05:00
Bence Romsics
3d5bed139c bump neutron-lib version to 1.19.0
This patch bumps the requirements and lower constraints to pick up
neutron-lib 1.19.0 so we can consume it.

Change-Id: Ib0e3d19c18e6688f274c0573331a4595f7dbdaf0
2018-10-03 12:01:56 +00:00
Matt Riedemann
0014c0c373 Add openstack/placement as a required project for neutron-grenade*
In order to get openstack/placement installed as part of the
neutron grenade jobs, we have to list it as a required project.

Needed by https://review.openstack.org/604454/

Change-Id: I742660f398b52c62503acf00aaf7faa9a5a8650a
2018-10-03 10:00:14 +00:00
Brian Haley
bb7b5a1e81 Create temp file in setUp() to avoid warning
The tempfile in test_unwatch_log() generates a warning
in the 'cover' tests:

sys:1: ResourceWarning: unclosed file
<_io.TextIOWrapper name='/var/tmp/tmpz1l83cix/tmpjz5uavc7/
 watch_log_temp_file_name' mode='a' encoding='UTF-8'>

Create it in setUp() which will trigger an automatic
cleanup on test completion.

Trivialfix

Change-Id: I816ac65a935250f8606dba75d7080eb9c384fceb
2018-10-03 10:00:03 +00:00
Sean Mooney
995744c576 Always set ovs bridge name in vif:binding-details
- This change updates _set_bridge_name to set
  the bridge name field in the vif binding details.
- This change adds the integration_bridge name
  to the agent configuration report.

Change-Id: I454efcb226745c585935d5bd1b3d378f69a55ca2
Closes-Bug: #1788009
2018-10-03 09:59:34 +00:00
Boden R
6a24efcb70 use payloads for AGENT BEFORE_DELETE callbacks
This patch switches BEFORE_DELETE callback events for AGENT resources
over to the payload style args use a DBEventPayload object. In addition,
the _delete_mac_associated_with_agent is now refactored into it's own
method to allow the context parameter to be parsed by
retry_if_session_inactive.

NeutronLibImpact

Change-Id: I0af951f4346f9290c2eba6aad17f772fbf27bb2f
2018-10-03 09:59:24 +00:00
Doug Hellmann
87d98dcbe2 Disable some pylint checks
Newer pylint added some checks that trigger a lot for this
code base. Turn them off until we are ready to apply the
new rules.  They are:

 - c-extension-no-member (Informational)
 - keyword-arg-before-vararg (Warning)
 - inconsistent-return-statements (Refactor recommendation)

Change-Id: I8c1f72bb334c87d62d47e8296d13c660d6bb5576
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-03 08:41:56 +00:00
Doug Hellmann
a8e8f88cde Remove a bare raise noticed by the linter
There is a bare raise in a function that is used as an exception
handler.  Remove it and have the caller raise inside it's except
block instead.

Change-Id: Ib494d320e1c2e6cc6daa20255e30291fc2e258e8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-03 08:41:26 +00:00
Doug Hellmann
cf463cce43 tell pylint to ignore python2 version of gettext
pylint compares the function arguments for gettext to what it can see,
and under python3 the signature does not match. This code is already
correctly branching based on python version, so just tell the linter
to ignore the line.

Change-Id: I653fe8bc11804dc20206f6296d89c14568ee4bc1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-03 08:39:35 +00:00
Hongbin Lu
b43b8c446d Remove population of is_filter keyword
The population of is_filter in network_ip_availability and
portbindings_extended modules was a walk-around for the missing
of this keyword in neutron-lib's resource attributes.
This issue is resolved in the release of neutron-lib 1.19.0
so this walk-around can be removed.

Depends-On: https://review.openstack.org/#/c/605690/
Change-Id: I7bb29bbe68f7e9afbc20704948661dd5e9dae912
2018-10-02 20:45:19 +00:00
Brian Haley
00de8f9a9e Do not fail deleting namespace if it does not exist
Note: this is a squash of two changes since they are
dependent on each other, and are currently blocking
the gate queue.

Sometimes cleanup methods are failing in the check and
gate queues trying to delete non-existing namespaces.
Since they could have been deleted asynchronously, don't
raise if the failure is "No such file or directory" since
the system is in the intended state.

Cleaned-up the DHCP agent to longer check for existence
first, and the tests to longer mock-out the namespace
exists check.

Fix test_legacy_router_lifecycle failures

Multi-path routes returned via the pyroute2 library have
their outgoing interfaces in the 'multipath' dictionary
element, not in the route dictionary.  In that case return
all the multipath routes correctly.

Change-Id: I5415cb3a88ff2640a19598a1fcb2278388815343
Closes-bug: #1795482
Closes-bug: #1795548
2018-10-02 09:52:22 -04:00
Zuul
f0ba3f99c8 Merge "Fix doc output examples" 2018-10-01 20:58:00 +00:00
Zuul
2a18c8ac33 Merge "Do not install centralized FIP if HA port is down" 2018-09-30 06:07:28 +00:00
tianhui
3e96bbade5 Fix doc output examples
Update the response of openstack network agent list

Change-Id: Idbc6cb24ffa0ff58eb5a67fd83508184310baac5
2018-09-30 02:29:47 +00:00
LIU Yulong
656a8f8729 Do not install centralized FIP if HA port is down
The issue scenario happens when we disassociate a floating IP
while the 'master' router host is restarted or powered-off.

When the L3 agent is powered-on again, the HA router state config
still remains 'master', but the ha port is down. And the message
queue still has one 'router_update' message (floating IP
disassociate message), so the L3 agent will sync this router info
at least twice during the restart, one is the router_update, the
other is the L3 agent full-sync.

The first one will add the centralized FIP to the qg-device, because
the router state is 'master'. So for DVR HA routers, only add the
centralized floating IP to the qg-device in the snat-namespace when
the HA port is up. For the restart procedure, if the HA port is up,
but the router is set to 'backup', do not add the floating IP.

Closes-Bug: #1794305
Change-Id: Ib39fe7dcd437a867c69852885c461a594167f6a1
2018-09-28 13:15:34 +00:00
Zuul
bf6844fba1 Merge "use is_retriable from neutron-lib" 2018-09-27 23:56:12 +00:00
Manjeet Singh Bhatia
6ef54ff379 Refactor l3hamode for ha migration.
Reduce the check requested_ha_state to one by adding
old_owner and new_owner to make it simple.

Change-Id: I7ae2a6862d9020ba527229fb46e0b889237ace26
2018-09-27 02:41:36 +00:00
Brian Haley
920f3e7fb5 Fix pep8 F402 import shadowing
F402 import 'router' from line 44 shadowed by loop variable

Trivialfix

Change-Id: Ia0d42506889074d3e84a54f3bf29240e7885245e
2018-09-26 22:01:55 -04:00
Zuul
5928d25613 Merge "fix spell error" 2018-09-27 02:00:00 +00:00
Zuul
e9a793aaf2 Merge "Add PortForwarding to neutron.objects entrypoint." 2018-09-27 01:32:37 +00:00
Zuul
56bcb6fe0a Merge "Remove async_process, moved to "common"" 2018-09-26 05:25:36 +00:00