From c1bd1e832393762fb24d6348bbedaf3f91c0cec9 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Fri, 8 Mar 2024 10:21:48 +0100 Subject: [PATCH] Fix two issues that broke tobiko gates 1. mypy version needs to be bumbed to avoid [1] 2. due to a change in neutron [2], tobiko heat templates need to be updated: when an OVN router is created, its ha value is omitted [1] https://github.com/python/mypy/issues/13627 [2] https://review.opendev.org/c/openstack/neutron/+/910889 Change-Id: I6c7fb32c6fa4fe6cd892a32cfeb1780d8d8be091 (cherry picked from commit cdd66eff32d7e979635b83602f77ad8461d89a57) --- .pre-commit-config.yaml | 2 +- tobiko/openstack/stacks/_neutron.py | 2 +- tobiko/tests/scenario/neutron/test_floating_ip.py | 1 + tobiko/tests/scenario/neutron/test_network.py | 1 + upper-constraints.txt | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28ff86b04..2a51caa18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: files: ^tobiko/ - repo: https://github.com/pre-commit/mirrors-mypy.git - rev: 'v0.931' + rev: 'v0.981' hooks: - id: mypy files: ^tobiko/ diff --git a/tobiko/openstack/stacks/_neutron.py b/tobiko/openstack/stacks/_neutron.py index 56ecb3aa7..3b725fed9 100644 --- a/tobiko/openstack/stacks/_neutron.py +++ b/tobiko/openstack/stacks/_neutron.py @@ -124,7 +124,7 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture): @property def router_value_specs(self) -> typing.Dict[str, typing.Any]: value_specs: typing.Dict[str, typing.Any] = {} - if self.has_l3_ha: + if self.has_l3_ha and not neutron.has_ovn(): value_specs.update(ha=bool(self.ha)) if self.distributed is not None and self.has_dvr: value_specs.update(distributed=bool(self.distributed)) diff --git a/tobiko/tests/scenario/neutron/test_floating_ip.py b/tobiko/tests/scenario/neutron/test_floating_ip.py index 5a4f61857..3eec94789 100644 --- a/tobiko/tests/scenario/neutron/test_floating_ip.py +++ b/tobiko/tests/scenario/neutron/test_floating_ip.py @@ -117,6 +117,7 @@ class FloatingIPTest(testtools.TestCase): # --- test l3_ha extension ------------------------------------------------ + @neutron.skip_unless_is_ovs() @neutron.skip_if_missing_networking_extensions('l3-ha') def test_l3_ha(self): """Test 'mtu' network attribute""" diff --git a/tobiko/tests/scenario/neutron/test_network.py b/tobiko/tests/scenario/neutron/test_network.py index df5b32b1c..d27adb86f 100644 --- a/tobiko/tests/scenario/neutron/test_network.py +++ b/tobiko/tests/scenario/neutron/test_network.py @@ -52,6 +52,7 @@ class NetworkTest(testtools.TestCase): # --- test l3_ha extension ------------------------------------------------ + @neutron.skip_unless_is_ovs() @neutron.skip_if_missing_networking_extensions('l3-ha') def test_l3_ha(self): """Test l3-ha network attribute""" diff --git a/upper-constraints.txt b/upper-constraints.txt index c50863a3c..bbb437ec2 100644 --- a/upper-constraints.txt +++ b/upper-constraints.txt @@ -213,8 +213,8 @@ mpmath===1.2.1 msgpack===1.0.3 munch===2.5.0 murano-pkg-check===0.3.0 -mypy===0.931 -mypy-extensions===0.4.3 +mypy===0.981 +mypy-extensions===1.0.0 ndg-httpsclient===0.5.1 netaddr===0.8.0 netifaces===0.11.0