1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
Author: Brian Haley <haleyb.dev@gmail.com>
Date: Sun, 22 Jun 2025 16:23:25 -0400
Description: Fix LoopingCallBase argument issue
I changed the argument order for LoopingCallBase based
on a pep8 failure, but it led to the code not working.
Changed caller to correctly specify the argument using
the 'f' keyword to fix the issue.
.
Bug: https://launchpad.net/bugs/2112492
Change-Id: Iceac2354a669939435c1ed0d32294abc56462f98
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
Origin: upstream, https://review.opendev.org/c/openstack/neutron/+/953064
Last-Update: 2025-07-01
Index: neutron/neutron/agent/metadata/agent.py
===================================================================
--- neutron.orig/neutron/agent/metadata/agent.py
+++ neutron/neutron/agent/metadata/agent.py
@@ -306,7 +306,7 @@ class UnixDomainMetadataProxy(proxy_base
report_interval = cfg.CONF.AGENT.report_interval
if report_interval:
self.heartbeat = loopingcall.FixedIntervalLoopingCall(
- self._report_state)
+ f=self._report_state)
self.heartbeat.start(interval=report_interval)
def _report_state(self):
Index: neutron/neutron/tests/unit/agent/metadata/test_agent.py
===================================================================
--- neutron.orig/neutron/tests/unit/agent/metadata/test_agent.py
+++ neutron/neutron/tests/unit/agent/metadata/test_agent.py
@@ -447,7 +447,7 @@ class TestUnixDomainMetadataProxy(base.B
server.assert_has_calls([
mock.call('/the/path', mock.ANY),
mock.call().serve_forever()])
- self.looping_mock.assert_called_once_with(p._report_state)
+ self.looping_mock.assert_called_once_with(f=p._report_state)
self.looping_mock.return_value.start.assert_called_once_with(
interval=mock.ANY)
|