23523 Commits

Author SHA1 Message Date
Hervé Beraud
3df1679658 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Also enabled the hacking check that should have caught this, it
was missing from tox.ini along with most of the other in-tree
hacking checks we have added over the years.

Change-Id: Id91175d0db8b8edc72f0dd98925ddbf7415bb881
2020-06-17 14:42:03 +00:00
Sean McGinnis
8913461aa9
Refactor assertEqual statement that includes 'True'
We have a hacking check to make sure assertTrue is used instead of
assertEqual(True, something). The regex used for that likely needs to be
fixed as it's overly complex for what it is trying to match.

We are seeing pep8 failures flagging an instance of assertEqual that is
comparing a tuple that happens to contain True as one of its values. As
an easier path to get around this failure until someone can reevaluate
the hacking check regex, this just reformats the test code so that it no
longer gets matched by the existing regex.

Change-Id: If2d2554f3509d3da7a6b625fd900d2090a3fe0f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-06-17 09:36:42 -05:00
Zuul
7d8f400791 Merge "Make neutron functional uwsgi jobs usable by other projects." 2020-06-13 18:13:57 +00:00
Zuul
4de18104ae Merge "[OVN] Create localnet port for each created segment" 2020-06-11 21:02:59 +00:00
Zuul
76b2ace079 Merge "port_forwarding: extend support for OVN usage (cont.)" 2020-06-10 18:45:10 +00:00
Zuul
646d2db6d1 Merge "ovn-migration: Stop ml2/ovs agents before installing OVN resources" 2020-06-10 17:48:12 +00:00
Zuul
b69e8892d9 Merge "ovn: Remove is_port_groups_supported() code" 2020-06-10 17:09:23 +00:00
Ghanshyam Mann
96f3b37b43 Make neutron functional uwsgi jobs usable by other projects.
neutron-fullstack-with-uwsgi and neutron-functional-with-uwsgi
jobs are run in devstack gate[1] also. On devstack side these jobs
are broken when migrated to zuulv3 and start using neutron defined
tox env. neutron gate is no issue as job find the tox env in neutron's
tox.ini but devstack does not.

We need to define the working dir to neutron so that any where
they are run they always look for the neutron's tox.ini for used
tox env.

Failure: https://review.opendev.org/#/c/577779/

[1] c3b58f5335/.zuul.yaml (L717)

Change-Id: I0cadebb45864a83dfba7b54c9f161d11611164db
2020-06-10 16:43:39 +00:00
Zuul
78511d958c Merge "[OVN] List a few missing feature parity gaps" 2020-06-10 07:33:33 +00:00
Zuul
344d43ec0a Merge "Remove unnecessary check if agent object from db is not None" 2020-06-10 03:10:09 +00:00
Zuul
5c303bd81b Merge "Bump oslo.log to version 4.2.1" 2020-06-10 03:06:54 +00:00
Zuul
0ae0e3d791 Merge "Limit ml2_vlan_allocations.vlan_id value in DB backend" 2020-06-09 23:37:42 +00:00
Lucas Alvares Gomes
d0daa49d6e [OVN] List a few missing feature parity gaps
What the first line of the commit says :-)

Change-Id: Ib29e2fefe74932d9cdae2bc509b135071863bfea
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2020-06-09 19:12:19 +00:00
Jakub Libosvar
9cbbd8de53 ovn: Remove is_port_groups_supported() code
Port_Groups table has been introduced in OVN 2.10 and we've moved in
master to newer version since. This patch removes all references to code
branching between port_groups and address_sets, and also removes
unneeded Address_Set commands and references.

Change-Id: I592d31db9be76d9be202d79d942e15b1668e3c0e
2020-06-09 14:19:56 +00:00
Maciej Józefczyk
483f468fdd [OVN] Create localnet port for each created segment
If new segment is created/old deleted we should update its
localnet port in related Logical_Switch.

Added also missing code to sync tool in order to delete provnet
ports in case of leftovers.

Change-Id: I6b864ba1c168643640a64bd7c25e1d0fc0ea348a
Related-Bug: 1865889
2020-06-09 12:16:21 +00:00
Zuul
f9091f326d Merge "Fix iptables rules comments" 2020-06-08 23:17:50 +00:00
Flavio Fernandes
eb46081150 port_forwarding: extend support for OVN usage (cont.)
This is a follow up from commit 102c442bcfa39074787e3292818880ecf238ac61

The call to resources_rpc.ResourcesPushRpcApi() will fail in situations
where RPC is not available. That is the case for neutron_ovn_db_sync_util.

The changes here will only set push_api if any of the configured service
plugins need it. This is a behavior similar to what is done for the QOS
plugin.

Related-Bug: #1877447
Change-Id: I3f2e18fabf4556cd708c6e544b5aaf37f72b44df
2020-06-08 18:58:47 -04:00
Zuul
3c040a5897 Merge "Remove translation sections from setup.cfg" 2020-06-08 20:04:09 +00:00
Zuul
cb5f42584e Merge "All Neutron ML2 drivers use Allocation/Endpoints OVO" 2020-06-08 13:13:36 +00:00
Zuul
64b92687a5 Merge "[OVN] Override notify_nova config in neutron-ovn-db-sync-util" 2020-06-05 20:52:28 +00:00
Zuul
da40765f99 Merge "Make NeutronOvsdbIdl singleton" 2020-06-05 19:32:05 +00:00
Brian Haley
4be0baa8cd Bump oslo.log to version 4.2.1
There were a couple of versions of oslo.log that were
not backwards-compatible. Now that a fixed version was
released, bump lower-constraints to require it and
remove the temporary workaround.

Change-Id: If38105ceaa48a0520ae8243982b736d0bc99ec3a
Related-bug: #1871840
2020-06-05 14:45:55 -04:00
Zuul
80050f49d4 Merge "Don't check if any bridges were recrected when OVS was restarted" 2020-06-05 16:16:35 +00:00
Zuul
c9d289f7e6 Merge "Fix Traceback when running neutron-ipset-cleanup tool" 2020-06-05 14:52:54 +00:00
Zuul
f6f82b18d9 Merge "Stop to use the __future__ module." 2020-06-05 14:25:29 +00:00
Rodolfo Alonso Hernandez
795aa6b9fa Limit ml2_vlan_allocations.vlan_id value in DB backend
Limit "ml2_vlan_allocations.vlan_id" values stored in the DB by
adding a check constraint in the DB engine. This check will
verify that vlan_id is in the interval [1, 4094].

Change-Id: Ie6453cb7a2ef0c43baf540c49a03079f4c8d3818
Closes-Bug: #1870400
2020-06-05 10:04:52 +00:00
Zuul
c6e5e119b8 Merge "Use pyroute2 for SRIOV VF commands" 2020-06-04 23:08:27 +00:00
Zuul
84793094bc Merge "Fix ssh to nodes during ML2/OVS to ML2/OVN migration" 2020-06-04 13:41:37 +00:00
Zuul
18d3d04d64 Merge "[OVN] Don't set virtual port type on ports with similar addresses" 2020-06-04 12:27:05 +00:00
Frode Nordahl
559ae06bdf
[OVN] Override notify_nova config in neutron-ovn-db-sync-util
If either ``notify_nova_on_port_status_changes`` or
``notify_nova_on_port_data_changes`` is set in the neutron
configuration provided to the ``neutron-ovn-db-sync-util`` tool it
will stop with a Traceback.

We are already overriding other parts of the ML2 Notification code
as we do not want it executing while syncing, so let's override
these configuration options if set as well.

Change-Id: I62765a14d376664ccc2ca3009bb9e970c9f25c03
Closes-Bug: #1882020
2020-06-04 14:11:15 +02:00
Hervé Beraud
236a0c4081 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ia7c6b8ba6d3842a19e75fd64f9e56f2cf5f74409
2020-06-04 08:34:47 +00:00
Zuul
489c32861c Merge "[OVN] Updates to tools/migrate_names.txt" 2020-06-04 04:55:09 +00:00
Slawek Kaplonski
d8eac6fa50 Fix iptables rules comments
In case when value of port['device'] don't starts with "tap_",
in comments to the conntrack or stateless rules in the iptables there
should be full port['device'] written. It will make things easier to
debug for the operators e.g. when using iptables_hybrid driver.

Change-Id: I427321fbb87865931b2b28abf7687d37e8d01a53
Closes-bug: #1880691
2020-06-03 16:29:22 +00:00
Maciej Józefczyk
e6023ecb48 [OVN] Don't set virtual port type on ports with similar addresses
Because of broken check why one port has similar address to the other
one, the first one by mistake could be set as virtual.
Example:
 port_1: 10.11.1.100
 port_2: 10.11.1.10

On create of port_2 it is set as 'virtual', but shouldn't.

This patch fixes that bug by using common function
utils.get_ovn_port_addresses().

Change-Id: Ia4b986146c77edf0616015380359e37233df80fc
Closes-Bug: #1881759
2020-06-03 11:00:18 +00:00
Rodolfo Alonso Hernandez
178227c8b6 Make NeutronOvsdbIdl singleton
"NeutronOvsdbIdl" should be a singleton class; only one instance
should be shared everywhere is called. Currently the connection
and the "OvsIdlMonitor" instances are global; those instances are
used to declare the "NeutronOvsdbIdl" instance.

As commented in the related bug, this singleton will ensure that
the OvsIdl indexes are created just once.

Change-Id: I639cf673a983b7b1be810495d8a8c2d89919a9b6
Related-Bug: #1881424
2020-06-03 10:50:33 +00:00
Frode Nordahl
d57735ae0f Fix Traceback when running neutron-ipset-cleanup tool
Some of the tools dependencies expect the AGENT group to be
present in the configuration, and at present it is not initialized,
this patch addresses that.

Change-Id: I1a50e77749aaecc3966c9d238f91a1968ed454ef
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Closes-Bug: #1881771
2020-06-02 19:28:25 +00:00
Brian Haley
1a3811448d Bump oslo.log to version 4.1.2
Versions of oslo.log >= 4.1.2 require a second argument when
initializing the OSJournalHandler class. While I've started
a review to fix that regression [0], bump oslo.log to a later
version that requires this new flag and pass it to fix the
gate.

Also had to blacklist the OVN tempest IPv6 hotplug test
since it is failing too much to pass the check jobs.

[0] https://review.opendev.org/732457

Change-Id: Ic9bbb43aa832ad6cc45d57328b40afe4468ddfca
Related-bug: #1871840
Related-bug: #1881558
2020-06-02 15:26:15 -04:00
Flavio Fernandes
132261aa70 [OVN] Updates to tools/migrate_names.txt
Updates to tools/migrate_names.txt to correctly represent
mapping between neutron and networking-ovn.

networking_ovn/common/ovn_client.py     neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
networking_ovn/common/acl.py            neutron/common/ovn/acl.py
doc/source/contributor/design           doc/source/contributor/internals/ovn

Change-Id: Ib8973ee96431815377a36f85e2bef0ef87e96ca1
2020-05-29 16:00:15 -04:00
Roman Safronov
0402337c15 Fix ssh to nodes during ML2/OVS to ML2/OVN migration
Migration ansible playbooks are not able to connect to overcloud
nodes using ssh due to bad settings in the generated ansible
inventory file. Ctlplane subnet ip addresses should be used by
ansible in order to be able to establish connection successfully.

Closes-bug: #1881029
Change-Id: I1588b88279ba1e25706cc74f4a888901e5aadcb6
2020-05-29 19:27:29 +00:00
Zuul
31280695a2 Merge "[OVN] Blacklist test_port_security_macspoofing_port test" 2020-05-29 17:44:44 +00:00
Zuul
118930f03d Merge "Promote functional uwsgi job to be voting" 2020-05-28 15:08:24 +00:00
Maciej Józefczyk
a32464464d [OVN] Blacklist test_port_security_macspoofing_port test
The test_port_security_macspoofing_port should be blacklisted
back, because of the change [1] that switched OVN_BRANCH/OVS_BRANCH
configuration to the latest stable releases and the
fix [2] that solved [3] is not yet present in latest release.

In addition. We will have discussion during next PTG around if we
should/could run only jobs with OVN release or we can enable also
master jobs. Then we need to explicitely define from which branch
given job runs to prevent such situations like this one in future.

[1] https://review.opendev.org/#/c/726168/
[2] https://patchwork.ozlabs.org/project/openvswitch/patch/20200319122641.473776-1-numans@ovn.org/
[3] https://bugs.launchpad.net/tempest/+bug/1728886

Related-Bug: #1728886

Change-Id: Ic8952e9ffb031ff4becb6ee2f6f5325a55e19dfe
2020-05-28 10:47:35 +00:00
Zuul
50846501f7 Merge "Mock command execution in "test_hybrid_plug_flag_based_on_firewall" UT" 2020-05-28 00:51:40 +00:00
Zuul
685d3dc50b Merge "[DVR] Reconfigure re-created physical bridges for dvr routers" 2020-05-27 18:08:51 +00:00
Rodolfo Alonso Hernandez
c5d8fd6329 Use pyroute2 for SRIOV VF commands
Recent changes in some versions of iproute2 CLI output (v4.18),
have invalidated the regular expression used to parse the
"ip link" output.

To solve this problem and avoid future ones, pyroute2 is used to
retrieve the virtual functions information and set the VF attributes
(spoofcheck, min_tx_rate, max_tx_rate and link_state).

pyroute2 extended the "ip link" support to retrieve this information,
adding "ext_mask=1" in the get command. If no virtual functions are
present in this particular network interface, the added method,
"get_link_vfs",  will return an empty list.

The set commands can return a "InterfaceOperationNotSupported" in
case the operation is not supported. For min_tx_rate, if the driver
does not support to set a minimum bandwidth, an "InvalidArgument"
(from a pyroute2.NetlinkError(22)) exception will be raised.

Change-Id: I680da4f64bd114f1caecaaeedbf8a4b1915a0849
Closes-Bug: #1878042
2020-05-27 16:58:02 +00:00
gugug
57fc472b33 Remove translation sections from setup.cfg
These translation sections are not needed anymore, Babel can
generate translation files without them.

Change-Id: I102c9ad3804705659d54c537681b525e1f8cc05d
2020-05-27 22:43:15 +08:00
Zuul
3f0fc7f9f2 Merge "[OVN] DOC Migration Strategy: Adjust formatting in code-block" 2020-05-27 12:47:03 +00:00
Zuul
d92d317873 Merge "Catch additional invalid mock import statement" 2020-05-27 07:50:57 +00:00
Zuul
e2b248f5ee Merge "Install "wmi" library in "win32" systems" 2020-05-26 18:04:26 +00:00
Zuul
1d8847f655 Merge "Remove usage of six.text_type and six.string_type" 2020-05-26 17:29:23 +00:00