From a8637461bb75604d86841db1b092b883f6031ca5 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Mon, 20 Jul 2026 09:48:20 +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_openwrt/system_mixin.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/napalm_openwrt/system_mixin.py b/napalm_openwrt/system_mixin.py index be1a69f..99d8ecf 100644 --- a/napalm_openwrt/system_mixin.py +++ b/napalm_openwrt/system_mixin.py @@ -501,11 +501,7 @@ class OpenWrtSystemMixin: # 1. LLDP daemon lldpd_path = self._send_command("which 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"}) pm = self._pm_type() @@ -538,8 +534,6 @@ class OpenWrtSystemMixin: pkg_names = [_pkg_name(ln, pm) for ln in upgradable] warnings.append({ "code": "updates_available", - "severity": "info", - "action": None, "meta": { "count": len(upgradable), "packages": pkg_names[:10], @@ -550,20 +544,12 @@ class OpenWrtSystemMixin: if pm == "opkg": auc_path = self._send_command("which auc 2>/dev/null").strip() if not auc_path: - warnings.append({ - "code": "update_notifications_disabled", - "severity": "warning", - "action": "install_auc", - }) + warnings.append({"code": "update_notifications_disabled"}) # 4. base64 not available — needed for efficient config apply b64_path = self._send_command("command -v base64 2>/dev/null").strip() if not b64_path: - warnings.append({ - "code": "no_base64", - "severity": "warning", - "action": "install_coreutils_base64", - }) + warnings.append({"code": "no_base64"}) return warnings