From 39f8d8035236e7061f5f51e1913fb41c034c2990 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Mon, 20 Jul 2026 09:49:38 +0200 Subject: [PATCH] refactor(warnings): report raw signal only, no severity/presentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_device_warnings() now returns only {code, meta} — severity, title, message, and action are resolved centrally by netork's WARNING_CATALOG (netork/core/device_warnings.py), not by the driver. Keeps this driver independent of netork and avoids per-vendor drift in how the same warning code is presented. --- napalm_proxmox/system_mixin.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/napalm_proxmox/system_mixin.py b/napalm_proxmox/system_mixin.py index b2aa271..89425ee 100644 --- a/napalm_proxmox/system_mixin.py +++ b/napalm_proxmox/system_mixin.py @@ -288,11 +288,7 @@ class ProxmoxSystemMixin: try: lldpd_path = self._exec_ssh_command("command -v lldpd 2>/dev/null").strip() if not lldpd_path: - warnings.append({ - "code": "lldpd_not_installed", - "severity": "warning", - "action": "install_lldpd", - }) + warnings.append({"code": "lldpd_not_installed"}) except Exception as exc: logger.debug("Failed to check for lldpd: %s", exc) @@ -302,13 +298,6 @@ class ProxmoxSystemMixin: if updates: warnings.append({ "code": "updates_available", - "severity": "warning", - "title": ( - f"{len(updates)} package update" - f"{'s' if len(updates) != 1 else ''} available" - ), - "message": None, - "action": None, "meta": { "count": len(updates), "packages": [u["name"] for u in updates], @@ -322,12 +311,7 @@ class ProxmoxSystemMixin: sub = self._get_node_subscription() status = sub.get("status", "") if status in ("NotFound", "Invalid", "Expired"): - warnings.append({ - "code": "no_subscription", - "severity": "warning", - "action": None, - "meta": {"status": status}, - }) + warnings.append({"code": "no_subscription", "meta": {"status": status}}) except Exception as exc: logger.debug("Failed to check subscription status: %s", exc)