fix: what bandit and the remaining lint rules found

- Long lines are wrapped: the get_environment awk command is split into
  adjacent string literals, the rollback message and the system mixin's
  docstring are wrapped; the command and the text are unchanged.
- The two except Exception: pass (the snmpd community in get_snmp_config,
  the network VLANs in get_ssids) now log at debug level (B110), so a
  swallowed failure leaves a trace.
- tests: raise ... from exc, unused loop variable.
This commit is contained in:
Christian Manivong committed 2026-10-23 08:33:29 +02:00
1 parent a212bc8715
commit 8b8905f0c7
5 files changed
+19 -7

No files matched your search

+5 -1
View File
@@ -12,9 +12,12 @@
from __future__ import annotations
import logging
import re
from typing import Any
logger = logging.getLogger(__name__)
class OpenWrtWirelessMixin:
"""Mixin providing wireless/radio NAPALM getters."""
@@ -155,7 +158,8 @@ class OpenWrtWirelessMixin:
if vlan is not None:
net_vlan[iface] = vlan
except Exception:
pass # Non-fatal: VLAN info is optional enrichment
# Non-fatal: VLAN info is optional enrichment.
logger.debug("network VLANs: ignored", exc_info=True)
# Build result; group entries with the same SSID name, merging bands
result: dict[str, Any] = {}