From 84b9b62e6a4b35d480d274231b024aa6d69bda82 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Thu, 2 Oct 2025 14:42:44 -0500 Subject: [PATCH] Fix periodic_resync thread in DHCP agent The thread tries to use threading.Event as a thread target. This prevents DHCP agent to start. Closes-Bug: #2127029 Change-Id: Iac731787ed858fe0c0f752e3bdf400005c5f40be Signed-off-by: Vladimir Kozhukalov --- neutron/agent/dhcp/agent.py | 2 +- neutron/tests/unit/agent/dhcp/test_agent.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/agent/dhcp/agent.py b/neutron/agent/dhcp/agent.py index 2bae73c2505..578154d0f3d 100644 --- a/neutron/agent/dhcp/agent.py +++ b/neutron/agent/dhcp/agent.py @@ -416,7 +416,7 @@ class DhcpAgent(manager.Manager): def periodic_resync(self): """Spawn a thread to periodically resync the dhcp state.""" - resync_thread = threading.Thread(target=self._periodic_resync_event) + resync_thread = threading.Thread(target=self._periodic_resync_helper) resync_thread.start() def safe_get_network_info(self, network_id): diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py index 462b3fdc536..7a6377f550b 100644 --- a/neutron/tests/unit/agent/dhcp/test_agent.py +++ b/neutron/tests/unit/agent/dhcp/test_agent.py @@ -592,7 +592,7 @@ class TestDhcpAgent(base.BaseTestCase): mock_t.return_value = None dhcp.periodic_resync() mock_t.assert_called_once_with( - target=dhcp._periodic_resync_event) + target=dhcp._periodic_resync_helper) def test_start_ready_ports_loop(self): dhcp = dhcp_agent.DhcpAgent(HOSTNAME)