2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-21 16:39:32 +00:00

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.
This commit is contained in:
Markus Hilger
2026-08-11 04:16:29 +02:00
parent 1a4475f64e
commit acd6bb228c
4 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -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():
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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