Skip to content

Commit edbd405

Browse files
authored
Merge pull request #72 from stackhpc/upstream/master-2025-09-15
Synchronise master with upstream
2 parents 5e82025 + df5a980 commit edbd405

File tree

13 files changed

+40
-34
lines changed

13 files changed

+40
-34
lines changed

ovn_octavia_provider/driver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def _fip_sync(self, loadbalancer):
823823
if fips:
824824
neutron_fip = fips[0].floating_ip_address
825825
if not vip_lsp:
826-
LOG.warn(
826+
LOG.warning(
827827
"Logic Switch Port not found for port "
828828
f"{loadbalancer.vip_port_id}. "
829829
"Skip sync FIP for loadbalancer "
@@ -832,7 +832,7 @@ def _fip_sync(self, loadbalancer):
832832
"first to sync OVN DB with Neutron DB.")
833833
return
834834
if lsp_fip != neutron_fip:
835-
LOG.warn(
835+
LOG.warning(
836836
"Floating IP not consistent between Logic Switch "
837837
f"Port and Neutron. Found FIP {lsp_fip} "
838838
f"in LSP {vip_lsp.name}, but we have {neutron_fip} from "
@@ -845,10 +845,10 @@ def _fip_sync(self, loadbalancer):
845845
vip_lp=vip_lsp, fip=lsp_fip,
846846
action=ovn_const.REQ_INFO_ACTION_SYNC)
847847
else:
848-
LOG.warn("Floating IP not found for loadbalancer "
849-
f"{loadbalancer.loadbalancer_id}")
848+
LOG.warning("Floating IP not found for loadbalancer "
849+
f"{loadbalancer.loadbalancer_id}")
850850
if lsp_fip:
851-
LOG.warn(
851+
LOG.warning(
852852
"Floating IP not consistent between Logic Switch "
853853
f"Port and Neutron. Found FIP {lsp_fip} configured "
854854
f"in LSP {vip_lsp.name}, but no FIP configured from "

ovn_octavia_provider/hacking/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
r"\bfrom[\s]+ovn_octavia_provider[\s]+import[\s]+tests\b")
4343
no_line_continuation_backslash_re = re.compile(r'.*(\\)\n')
4444

45-
import_mock = re.compile(r"\bimport[\s]+mock\b") # noqa: H216
45+
import_mock = re.compile(r"\bimport[\s]+mock\b") # noqa :H216
4646
import_from_mock = re.compile(r"\bfrom[\s]+mock[\s]+import\b")
4747

4848

ovn_octavia_provider/helper.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def _get_neutron_client(self):
467467
try:
468468
return clients.get_neutron_client()
469469
except driver_exceptions.DriverError as e:
470-
LOG.warn(f"Cannot get client from neutron {e}")
470+
LOG.warning(f"Cannot get client from neutron {e}")
471471
return None
472472

473473
def _get_vip_port_and_subnet_from_lb(self, neutron_client, vip_port_id,
@@ -482,10 +482,10 @@ def _get_vip_port_and_subnet_from_lb(self, neutron_client, vip_port_id,
482482
subnet_requested
483483
)
484484
except openstack.exceptions.ResourceNotFound:
485-
LOG.warn("Load balancer VIP port and subnet not found.")
485+
LOG.warning("Load balancer VIP port and subnet not found.")
486486
return None, None
487487
except AttributeError:
488-
LOG.warn("Load Balancer VIP port missing information.")
488+
LOG.warning("Load Balancer VIP port missing information.")
489489
return None, None
490490

491491
def _build_external_ids(self, loadbalancer, port):
@@ -3179,7 +3179,7 @@ def get_lsp(self, port_id, network_id):
31793179
try:
31803180
ls = self.ovn_nbdb_api.lookup('Logical_Switch', ls_name)
31813181
except idlutils.RowNotFound:
3182-
LOG.warn(f"Logical Switch {ls_name} not found.")
3182+
LOG.warning(f"Logical Switch {ls_name} not found.")
31833183
return
31843184
for port in ls.ports:
31853185
if port_id in port.name:
@@ -3211,9 +3211,9 @@ def get_fip_from_vip(self, lb):
32113211
try:
32123212
return list(neutron_client.ips(port_id=lb.vip_port_id))
32133213
except openstack.exceptions.HttpException as e:
3214-
LOG.warn("Error on fetch fip for "
3215-
f"{lb.loadbalancer_id} "
3216-
f"Error: {str(e)}")
3214+
LOG.warning("Error on fetch fip for "
3215+
f"{lb.loadbalancer_id} "
3216+
f"Error: {str(e)}")
32173217

32183218
def _add_lbhc(self, ovn_lb, pool_key, info):
32193219
hm_id = info[constants.ID]
@@ -3787,7 +3787,8 @@ def hm_sync(self, hm, ovn_lb, pool_key):
37873787
:param ovn_lb: The OVN LoadBalancer object that needs to be sync
37883788
:param pool_key: The pool_key where health monitor is associated
37893789
"""
3790-
lbhcs, ovn_lb = self._find_ovn_lb_from_hm_id(hm[constants.ID])
3790+
lbhcs, _ovn_lb = self._find_ovn_lb_from_hm_id(hm[constants.ID])
3791+
ovn_lb = _ovn_lb if _ovn_lb else ovn_lb
37913792
if not lbhcs:
37923793
LOG.debug("Loadbalancer health check %s not found!",
37933794
hm[constants.ID])

ovn_octavia_provider/tests/functional/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import time
1818
from unittest import mock
1919

20-
from neutron.common import utils as n_utils
20+
from neutron.common import utils as n_utils # noqa: N530
2121
from neutron_lib import constants as n_const
2222
from neutron_lib.plugins import directory
2323
from octavia_lib.api.drivers import data_models as octavia_data_model
@@ -33,7 +33,7 @@
3333

3434
# NOTE(mjozefcz): We need base neutron functionals because we need
3535
# mechanism driver and l3 plugin.
36-
from neutron.tests.functional import base
36+
from neutron.tests.functional import base # noqa: N530
3737
from ovn_octavia_provider.common import clients
3838
from ovn_octavia_provider.common import constants as ovn_const
3939
from ovn_octavia_provider import driver as ovn_driver
@@ -115,7 +115,7 @@ def _create_provider_network(self):
115115

116116
def _create_lb_model(self, vip=None, vip_network_id=None,
117117
vip_subnet_id=None, vip_port_id=None,
118-
admin_state_up=True, additional_vips=[]):
118+
admin_state_up=True, additional_vips=None):
119119
lb = octavia_data_model.LoadBalancer()
120120
lb.loadbalancer_id = uuidutils.generate_uuid()
121121

@@ -486,7 +486,7 @@ def _create_load_balancer_and_validate(self, network_id, subnet_id,
486486
only_model=False,
487487
router_id=None,
488488
multiple_lb=False,
489-
additional_vips=[]):
489+
additional_vips=None):
490490
self._o_driver_lib.update_loadbalancer_status.reset_mock()
491491
lb_data = {}
492492
if router_id:

ovn_octavia_provider/tests/functional/test_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import atexit
1717
import multiprocessing as mp
1818

19-
from neutron.common import utils as n_utils
19+
from neutron.common import utils as n_utils # noqa: N530
2020
from oslo_utils import uuidutils
2121
from ovsdbapp.backend.ovs_idl import connection
2222

ovn_octavia_provider/tests/unit/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414
from unittest import mock
1515

16-
from neutron.tests import base
16+
from neutron.tests import base # noqa: N530
1717
from octavia_lib.api.drivers import driver_lib
1818
from oslo_utils import uuidutils
1919

ovn_octavia_provider/tests/unit/common/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from unittest import mock
1818

19-
from neutron.tests import base
19+
from neutron.tests import base # noqa: N530
2020

2121
from ovn_octavia_provider.common import config as ovn_config
2222
from ovn_octavia_provider.common import utils

ovn_octavia_provider/tests/unit/ovsdb/test_impl_idl_ovn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
from unittest import mock
1717

18-
from neutron.tests import base
18+
from neutron.tests import base # noqa: N530
1919
from ovs.db import idl as ovs_idl
2020
from ovsdbapp.backend import ovs_idl as real_ovs_idl
2121
from ovsdbapp.backend.ovs_idl import idlutils

ovn_octavia_provider/tests/unit/test_driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def test_fip_sync_os_err(self, net_cli):
917917

918918
with mock.patch.object(ovn_driver, 'LOG') as m_l:
919919
self.driver._fip_sync(self.ref_lb_fully_sync_populated)
920-
m_l.warn.assert_has_calls(calls)
920+
m_l.warning.assert_has_calls(calls)
921921

922922
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
923923
def test_fip_sync_lsp_mismatch(self, net_cli):
@@ -934,7 +934,7 @@ def test_fip_sync_lsp_mismatch(self, net_cli):
934934

935935
with mock.patch.object(ovn_driver, 'LOG') as m_l:
936936
self.driver._fip_sync(self.ref_lb_fully_sync_populated)
937-
m_l.warn.assert_called_once_with(msg)
937+
m_l.warning.assert_called_once_with(msg)
938938

939939
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
940940
def test_fip_sync_lsp_not_found(self, net_cli):
@@ -952,7 +952,7 @@ def test_fip_sync_lsp_not_found(self, net_cli):
952952

953953
with mock.patch.object(ovn_driver, 'LOG') as m_l:
954954
self.driver._fip_sync(self.ref_lb_fully_sync_populated)
955-
m_l.warn.assert_called_once_with(msg)
955+
m_l.warning.assert_called_once_with(msg)
956956

957957
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
958958
def test_fip_sync_no_neutron_fip(self, net_cli):
@@ -971,7 +971,7 @@ def test_fip_sync_no_neutron_fip(self, net_cli):
971971
self.mock_add_request
972972
with mock.patch.object(ovn_driver, 'LOG') as m_l:
973973
self.driver._fip_sync(self.ref_lb_fully_sync_populated)
974-
m_l.warn.assert_has_calls(calls)
974+
m_l.warning.assert_has_calls(calls)
975975

976976
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
977977
def test_fip_sync_no_neutron_fip_no_lsp(self, net_cli):

ovn_octavia_provider/tests/unit/test_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def test_lb_sync_client_exception(self, net_cli):
10451045
net_cli.side_effect = [exceptions.DriverError]
10461046
with mock.patch.object(ovn_helper, 'LOG') as m_l:
10471047
self.assertFalse(self.helper.lb_sync(self.lb, self.ovn_lb))
1048-
m_l.warn.assert_called_once_with(
1048+
m_l.warning.assert_called_once_with(
10491049
('Cannot get client from neutron An unknown driver error '
10501050
'occurred.')
10511051
)
@@ -1057,7 +1057,7 @@ def test_lb_sync_exception_missing_info(self, net_cli, m_gpri):
10571057
m_gpri.side_effect = [AttributeError]
10581058
with mock.patch.object(ovn_helper, 'LOG') as m_l:
10591059
self.assertFalse(self.helper.lb_sync(self.lb, self.ovn_lb))
1060-
m_l.warn.assert_called_once_with(
1060+
m_l.warning.assert_called_once_with(
10611061
("Load Balancer VIP port missing information.")
10621062
)
10631063

@@ -1068,7 +1068,7 @@ def test_lb_sync_exception_vip_port_not_found(self, net_cli, m_gpri):
10681068
m_gpri.side_effect = [openstack.exceptions.ResourceNotFound]
10691069
with mock.patch.object(ovn_helper, 'LOG') as m_l:
10701070
self.assertFalse(self.helper.lb_sync(self.lb, self.ovn_lb))
1071-
m_l.warn.assert_called_once_with(
1071+
m_l.warning.assert_called_once_with(
10721072
("Load balancer VIP port and subnet not found.")
10731073
)
10741074

@@ -4457,7 +4457,7 @@ def test_get_lsp(self):
44574457
with mock.patch.object(ovn_helper, 'LOG') as m_l:
44584458
self.assertIsNone(self.helper.get_lsp(port_id=port_id,
44594459
network_id=network_id))
4460-
m_l.warn.assert_called_once_with(
4460+
m_l.warning.assert_called_once_with(
44614461
f'Logical Switch neutron-{network_id} not found.')
44624462

44634463
def test_get_lsp_port_not_found(self):

0 commit comments

Comments
 (0)