From acd6bb228c6e12312246fa3fab28ed3e2217ae1e Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 11 Aug 2026 04:16:29 +0200 Subject: [PATCH] Clear the last findings in four ruff groups Each is the only thing keeping its rule group from being selectable whole. userutil.py imported ctypes with a star; the names it uses are POINTER, byref, c_char_p, c_int, c_int32, c_uint and cdll. The oem lookup loop had an else with no break, so the else always ran. The alert parameter table wrapped int in a lambda that only forwards to it. And the watchdog interval passed 0 where os.environ.get documents a string, which worked because int(0) is 0. --- confluent_server/aiohmi/ipmi/oem/lookup.py | 3 +-- confluent_server/confluent/main.py | 2 +- confluent_server/confluent/messages.py | 2 +- confluent_server/confluent/userutil.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/confluent_server/aiohmi/ipmi/oem/lookup.py b/confluent_server/aiohmi/ipmi/oem/lookup.py index a55ba37e..08b8e815 100755 --- a/confluent_server/aiohmi/ipmi/oem/lookup.py +++ b/confluent_server/aiohmi/ipmi/oem/lookup.py @@ -42,8 +42,7 @@ async def get_oem_handler(oemid, ipmicmd, *args): ): if item in oemmap: return (await oemmap[item].OEMHandler.create(oemid, ipmicmd, *args), True) - else: - return await generic.OEMHandler.create(oemid, ipmicmd, *args), False + return await generic.OEMHandler.create(oemid, ipmicmd, *args), False def load_plugins(): diff --git a/confluent_server/confluent/main.py b/confluent_server/confluent/main.py index 2b64f883..e1acc6a2 100644 --- a/confluent_server/confluent/main.py +++ b/confluent_server/confluent/main.py @@ -359,7 +359,7 @@ async def asyncrun(args): sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) sock.connect(notifysock) sock.send(b'READY=1') - watchdogsecs = int(os.environ.get('WATCHDOG_USEC', 0)) / 1000000 + watchdogsecs = int(os.environ.get('WATCHDOG_USEC', '0')) / 1000000 if not watchdogsecs: watchdogsecs = 200 watchdogsecs = watchdogsecs / 2 diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 69173a3b..fac546e4 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -1665,7 +1665,7 @@ class InputAlertDestination(ConfluentMessage): 'acknowledge': lambda x: False if type(x) in (unicode, bytes) and x.lower() == 'false' else bool(x), 'acknowledge_timeout': lambda x: int(x) if x and x.isdigit() else None, 'ip': lambda x: x, - 'retries': lambda x: int(x) + 'retries': int } def __init__(self, path, nodes, inputdata, multinode=False): diff --git a/confluent_server/confluent/userutil.py b/confluent_server/confluent/userutil.py index 72b8f945..7a35de17 100644 --- a/confluent_server/confluent/userutil.py +++ b/confluent_server/confluent/userutil.py @@ -1,4 +1,4 @@ -from ctypes import * +from ctypes import POINTER, byref, c_char_p, c_int, c_int32, c_uint, cdll from ctypes.util import find_library import confluent.util as util import grp