fix: sysctl remote error tail report

This commit is contained in:
sascha 2026-08-08 22:25:43 +02:00
parent 2ed8949aaf
commit fcf1fb3816

2
app.py
View file

@ -1250,7 +1250,7 @@ async def system_sysctl_audit(host: str, _=Depends(_verify)):
target = f'{inventory["user"]}@{inventory["ip"]}' target = f'{inventory["user"]}@{inventory["ip"]}'
rc, out, err = await asyncio.to_thread(_ssh, target, _sysctl_audit_command(), 30) rc, out, err = await asyncio.to_thread(_ssh, target, _sysctl_audit_command(), 30)
if rc != 0: if rc != 0:
raise HTTPException(502, (err or out).strip()[:300] or "sysctl audit failed") raise HTTPException(502, (err or out).strip()[-500:] or "sysctl audit failed")
try: try:
result = json.loads(out) result = json.loads(out)
except json.JSONDecodeError as exc: except json.JSONDecodeError as exc: