fix: what bandit and the remaining lint rules found

- driver.py: the logger is defined after the imports (E402). The lazy
  paramiko client is annotated Any, as _node_ssh already is; the quoted
  paramiko.SSHClient named a module that is never imported there (F821).
- Unused locals are gone: get_facts' hostname, get_users' groups (both
  read a value nobody used), the ARP flags column is _flags; the output is
  unchanged.
- Long lines are wrapped: the apt-get and snmpd.conf commands are split
  into adjacent string literals, the power-action error message and the
  system mixin's docstring are wrapped; the text is unchanged.
- get_vm_status re-raises with raise ... from e (B904).
- The two except Exception: pass (closing the SSH session, the is_alive
  probe) now log at debug level (B110), so a swallowed failure leaves a
  trace.
- nosec for the empty "password" field of NAPALM's get_users shape and
  the ssh_password_auth flag (B105); all three are false positives.
- tests: unused loop variables.
This commit is contained in:
Christian Manivong committed 2026-10-23 08:39:01 +02:00
1 parent 3b873d91fe
commit 3365207c98
6 files changed
+28 -19

No files matched your search

+1 -1
View File
@@ -174,7 +174,7 @@ class ProxmoxInterfaceMixin:
parts = line.split()
if len(parts) < 6:
continue
ip_addr, _, flags, mac, _, iface = (
ip_addr, _, _flags, mac, _, iface = (
parts[0],
parts[1],
parts[2],