mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
arch-audit: handle any error
This commit is contained in:
parent
97c553aa41
commit
618ca3c9aa
1 changed files with 12 additions and 0 deletions
12
misc/vuln.py
12
misc/vuln.py
|
|
@ -1,5 +1,7 @@
|
|||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
import traceback
|
||||
from dataclasses import dataclass
|
||||
from enum import StrEnum
|
||||
from typing import Optional
|
||||
|
|
@ -52,4 +54,14 @@ async def get_vulns() -> list[Vulnerability]:
|
|||
)
|
||||
)
|
||||
return []
|
||||
except Exception as exc:
|
||||
await alerts.send_alert(
|
||||
alerts.Alert(
|
||||
alert_type=alerts.AlertType.ERROR,
|
||||
message=f"arch-audit failed to run: {repr(exc)}, see logs",
|
||||
severity=alerts.Severity.CRITICAL,
|
||||
)
|
||||
)
|
||||
logging.error(traceback.format_exc())
|
||||
return []
|
||||
return _parse_arch_audit_output(arch_audit_output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue