From 0e4531adc7a1d5c631a83384b32f0418f225c788 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 13 Jun 2025 14:19:11 -0400 Subject: [PATCH] Fix keyword-arg-before-vararg warning When trying to use a copy of code in loopingcall.py in a neutron backport, it threw this pep8 warning: pep8: W1113: Keyword argument before variable positional arguments list in the definition of init function (keyword-arg-before-vararg) We must be using slightly different versions of pylint since I don't see the failure in oslo.service. Changed the arguments around in a couple of places to avoid the warning. TrivialFix Change-Id: I35995209981a6f48926a4359fbbf30d07cd5e1e6 --- oslo_service/backend/threading/loopingcall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oslo_service/backend/threading/loopingcall.py b/oslo_service/backend/threading/loopingcall.py index 7abad429..df8b3d9a 100644 --- a/oslo_service/backend/threading/loopingcall.py +++ b/oslo_service/backend/threading/loopingcall.py @@ -98,7 +98,7 @@ class LoopingCallBase: _RUN_ONLY_ONE_MESSAGE = _( "A looping call can only run one function at a time") - def __init__(self, f=None, *args, **kwargs): + def __init__(self, *args, f=None, **kwargs): self.args = args self.kwargs = kwargs self.f = f @@ -293,7 +293,7 @@ class BackOffLoopingCall(LoopingCallBase): "A dynamic backoff interval looping call can only run one function at" " a time") - def __init__(self, f=None, *args, **kwargs): + def __init__(self, *args, f=None, **kwargs): super().__init__(f=f, *args, **kwargs) self._error_time = 0 self._interval = 1