Commit Graph
114 Commits
Author SHA1 Message Date
christianmanivong 60ff9d9700 Merge pull request 'fix: six open bugs (#4, #43, #21, #17, #15, #6)' (#54) from fix/bugs-2026-11 into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 1m2s
driver / lowest (push) Successful in 36s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m27s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 1m9s
driver / test (3.12) (push) Successful in 1m10s
CI / driver (push) Successful in 3m8s
2026-11-01 22:10:02 +00:00
Christian Manivong 897892b923 fix(routes): give the IPv6 default route ::/0
driver / lowest (pull_request) Successful in 37s
driver / test (3.13) (pull_request) Successful in 1m14s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m20s
CI / driver (pull_request) Successful in 2m59s
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / publish (pull_request) Skipped
get_route_to read "ip -4 route show && ip -6 route show" as one output
and mapped "default" to 0.0.0.0/0; the "default6" branch meant for IPv6
never matches, because ip -6 also prints "default". A dual-stack host
showed two 0.0.0.0/0 routes, one of them family ipv6. Each family is now
read with its own command, so "default" becomes ::/0 for IPv6 and a host
route without a prefix length a /128 there instead of a /32.

The line parse moves to napalm_linux/_routes.py.

Closes #6
2026-11-01 21:50:33 +01:00
Christian Manivong 69f1701ea6 fix(ping): read BusyBox's ping and IPv6 replies
ping() only knew the iputils summary. BusyBox, the ping on Alpine,
writes "2 packets received", so every target came back as an error and
the ping sweep counted it as down. Its probe lines ("seq=") and every
IPv6 reply were dropped by an IPv4-only per-probe pattern, and its
"round-trip min/avg/max" line without a deviation was not read.

The parse moves to napalm_linux/_ping.py and accepts both summaries
(also iputils' with "+N errors"), both RTT lines, IPv6 and named
replies. The shared Unix ping parser is still open as
NAPALM/napalm-device-types#12.

Closes #15
2026-11-01 21:49:28 +01:00
Christian Manivong 024f68c543 fix(packages): leave removed packages with leftover config out of apt
dpkg-query -W also lists packages that were removed but whose
configuration dpkg keeps (state rc), and the driver marked every line
installed: old kernels and a removed agent showed up as installed
software. The query now asks for db:Status-Abbrev and drops packages
that are not installed or only left their configuration; held, unpacked
and half-configured packages keep counting, their files are on disk.

The dpkg query and its parse move to napalm_linux/_dpkg.py, a pure
function under strict mypy, which keeps linux.py inside its line count.

Closes #17
2026-11-01 21:48:05 +01:00
Christian Manivong 54f6844d84 fix(processes): keep ps's five-word start time in one field
get_processes split each ps line into 11 parts, but lstart is five
words, so started held only the weekday and command began with the rest
of the date. The line is now split into 15 parts, started joins the five
date words and command is the remainder. ps runs under LC_ALL=C: only
there are the weekday and month one word each on every host.

Closes #21
2026-11-01 21:46:34 +01:00
Christian Manivong df4f4b0e4d fix(vpn): make the WireGuard peer key's prefix URL-safe
get_vpn_tunnels keyed a peer as wireguard-<iface>-<pubkey[:8]>. Base64
uses "/" and "+", and the key is used as a URL path segment; a "/"
breaks the route even percent-encoded. The prefix now maps "+" to "-"
and "/" to "_", as napalm-opnsense does (NAPALM/napalm-opnsense#32).
Affected peers change their key once.

Closes #43
2026-11-01 21:45:42 +01:00
Christian Manivong eaa08ae7e3 fix(packages): read install_package's success from the exit status
install_package searched the output of `... || true` for words such as
"failed", the pattern uninstall_package left behind for netork#267: a
postinst that only mentions a failure read as a failed install, and a
failure phrased without those words read as success. It now runs through
_sudo_status like the removal and falls back to the keywords only when
the channel gave no exit status.

The ruff findings named in the issue are gone since the driver adopted
the standard; strict mypy for linux.py is held by the quality ratchet,
and the None-vs-dict package contract is NAPALM/napalm-device-types#36.

Closes #4
2026-11-01 21:44:51 +01:00
christianmanivong a729b35d8b Merge pull request 'feat: netOrk's own account with a fixed uid (NetOrk/netork#1817)' (#53) from feature/system-user-uid-1817 into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m7s
driver / lowest (push) Successful in 39s
driver / build (push) Failing after 7s
driver / security (push) Successful in 1m15s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 1m9s
driver / test (3.12) (push) Successful in 1m6s
CI / driver (push) Failing after 2m57s
2026-11-01 12:44:20 +00:00
Christian Manivong e9a1fc7ff9 feat: netOrk's own account with a fixed uid (NetOrk/netork#1817)
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m6s
CI / driver (pull_request) Successful in 2m37s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m4s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 57s
driver / publish (pull_request) Skipped
_account_create_with_uid makes it with useradd -m -u <uid>; below UID_MIN
useradd warns and goes on, as for a system's account.
2026-11-01 12:42:30 +01:00
christianmanivong f49d1ca7f5 Merge pull request 'test: check the proxy fix's own steps, not every step the mixin runs' (#52) from fix/apt-https-step into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m2s
driver / lowest (push) Successful in 34s
driver / build (push) Successful in 32s
driver / security (push) Successful in 1m11s
driver / publish (push) Skipped
driver / standard (push) Successful in 23s
driver / types (push) Successful in 1m11s
driver / test (3.12) (push) Successful in 1m11s
CI / driver (push) Successful in 3m2s
2026-11-01 07:13:43 +00:00
Christian Manivong dd351f1077 test: check the proxy fix's own steps, not every step the mixin runs
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m32s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / publish (pull_request) Skipped
napalm-device-types adds an https step to configure_package_proxy
(NetOrk/netork#1811). It runs on the transports this driver already has, so
the test checks the four steps it supplies and lets later ones be.
2026-11-01 07:58:10 +01:00
christianmanivong b702fa5125 Merge pull request 'feat: personal accounts with shadow-utils, locked by expiry (NetOrk/netork#1793)' (#50) from feat/local-accounts into main
driver / lint (push) Successful in 14s
driver / lowest (push) Successful in 30s
driver / test (3.13) (push) Successful in 1m1s
driver / build (push) Successful in 27s
driver / security (push) Successful in 59s
driver / publish (push) Skipped
driver / standard (push) Successful in 15s
driver / test (3.12) (push) Failing after 5s
driver / types (push) Successful in 1m3s
CI / driver (push) Failing after 1m48s
Reviewed-on: #50
2026-10-31 23:51:03 +00:00
Christian Manivong 448eeec0fa refactor: the interactive shell's end-of-output pattern lives in _shell (quality ratchet)
driver / test (3.13) (pull_request) Successful in 1m11s
driver / lowest (pull_request) Successful in 35s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Successful in 3m5s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m15s
driver / test (3.12) (pull_request) Successful in 1m19s
driver / publish (pull_request) Skipped
expect_for and STATUS_ECHO_RE say when netmiko's interactive shell has
finished printing a command's output, next to PROMPT_RE they build on.
Moving them out keeps linux.py within its line count now that it mixes in
the personal accounts; the baseline goes down to 2265.
2026-11-01 00:48:02 +01:00
Christian Manivong 9ce915a8b9 Merge remote-tracking branch 'origin/main' into feat/local-accounts
# Conflicts:
#	CHANGELOG.md
2026-11-01 00:48:02 +01:00
christianmanivong 812a162eef Merge pull request 'feat: open() waits out sshd's per-source penalty (NetOrk/netork#1800)' (#51) from feat/ssh-penalties-1800 into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 1m3s
driver / lowest (push) Successful in 28s
driver / build (push) Successful in 25s
driver / security (push) Successful in 58s
driver / publish (push) Skipped
driver / standard (push) Successful in 14s
driver / types (push) Successful in 1m4s
driver / test (3.12) (push) Successful in 1m5s
CI / driver (push) Successful in 2m15s
Reviewed-on: #51
2026-10-31 23:36:46 +00:00
Christian Manivong bff275402e fix: keep linux.py within its line count (quality ratchet)
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Successful in 2m14s
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m5s
driver / test (3.13) (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / publish (pull_request) Skipped
One handler for the two netmiko failures that both became a
ConnectionException, and the retry's note on its own line.
2026-11-01 00:33:32 +01:00
Christian Manivong 49b7d7fef7 feat: open() waits out sshd's per-source penalty (NetOrk/netork#1800)
driver / test (3.13) (pull_request) Failing after 59s
driver / lowest (pull_request) Failing after 28s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Failing after 2m17s
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Failing after 15s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / publish (pull_request) Skipped
OpenSSH 9.8+ closes every connection from a source it has just
penalised, before its banner, for seconds to minutes. open() now wraps
netmiko's ConnectHandler in napalm-device-types' retry_refused, so the
connection is tried again after 1, 3, 7 and 15 s instead of failing.
Needs NAPALM/napalm-device-types#63.
2026-11-01 00:26:47 +01:00
Christian Manivong c5be71adac feat: personal accounts with shadow-utils, locked by expiry (NetOrk/netork#1793)
driver / lowest (pull_request) Failing after 41s
driver / build (pull_request) Successful in 42s
driver / security (pull_request) Successful in 1m29s
CI / driver (pull_request) Failing after 3m19s
driver / standard (pull_request) Failing after 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Failing after 1m17s
driver / test (3.12) (pull_request) Failing after 1m19s
driver / test (3.13) (pull_request) Failing after 1m7s
driver / publish (pull_request) Skipped
LinuxDriver mixes in napalm-device-types' LocalAccountsMixin with
useradd -m -s /bin/bash, usermod and gpasswd -d. A locked account is an
expired one (usermod -L -e 1): PAM refuses it a key login too, where a
"!" in front of the password stops only the password. Opening it again
lifts the expiry and gives the old password back.

Checked on Debian 13 and Rocky Linux 9 containers with sshd and sudo:
key login works after adding, is refused after locking and works again
after reopening; the sudo rule takes effect with the person's password;
membership of sudo/wheel goes when sudo is not wanted.
2026-10-31 23:24:27 +01:00
christianmanivong 7550b884b0 Merge pull request 'feat: count and remove the sudo password the old _sudo left in histories (NetOrk/netork#1090)' (#48) from feat/sudo-history-cleanup into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m1s
driver / lowest (push) Successful in 38s
driver / build (push) Successful in 36s
driver / security (push) Successful in 1m20s
driver / publish (push) Skipped
driver / standard (push) Successful in 20s
driver / types (push) Successful in 1m15s
driver / test (3.12) (push) Successful in 1m15s
CI / driver (push) Successful in 3m2s
2026-10-30 20:52:36 +00:00
Christian Manivong fbaded5913 feat: count and remove the sudo password the old _sudo left in histories (NetOrk/netork#1090)
driver / lowest (pull_request) Successful in 59s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m30s
CI / driver (pull_request) Successful in 3m6s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m4s
driver / test (3.13) (pull_request) Successful in 1m10s
driver / publish (pull_request) Skipped
Until NetOrk/netork#1039, _sudo typed `echo '<password>' | sudo -S -p ""
<command>` into netmiko's interactive shell, so the login user's history
kept the password once per command, and the part after the first `&&` ran
without root, leaving snmpd.conf and apt's 00proxy to the login user.

LinuxDriver mixes in napalm-device-types' SudoHistoryMixin and names what
to look for: the marker "| sudo -S -p " and those two files.
get_history_sudo_lines() and remove_history_sudo_lines() run on the exec
channel; OpenMediaVault and QNAP inherit both.

The _privileged docstring points at _as_root instead of restating it, so
linux.py does not grow.

Requires the napalm-device-types release with SudoHistoryMixin.
2026-10-30 21:09:33 +01:00
christianmanivong 4cd1710e19 Merge pull request 'fix: an unknown ARP age is -1.0, not 0.0' (#47) from fix/arp-unknown-age into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 1m2s
driver / lowest (push) Successful in 37s
driver / build (push) Successful in 33s
driver / security (push) Successful in 1m20s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / types (push) Successful in 1m8s
driver / test (3.12) (push) Successful in 1m8s
CI / driver (push) Successful in 2m55s
2026-10-30 09:11:41 +00:00
Christian Manivong 05cef25e9b fix: an unknown ARP age is -1.0, not 0.0
driver / test (3.13) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 2m54s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / publish (pull_request) Skipped
ip neigh has no age, and a STALE entry may be hours old, so get_arp_table
reports ARP_AGE_UNKNOWN instead of 0.0 ("confirmed just now").

NetOrk/netork#1327
2026-10-30 08:37:08 +01:00
christianmanivong 2ffad23bf0 Merge pull request 'feat: set_hostname renames the host (#45)' (#46) from feat/set-hostname-45 into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m8s
driver / lowest (push) Successful in 31s
driver / build (push) Successful in 39s
driver / security (push) Successful in 1m23s
driver / publish (push) Skipped
driver / standard (push) Successful in 21s
driver / types (push) Successful in 1m12s
driver / test (3.12) (push) Successful in 1m11s
CI / driver (push) Successful in 2m51s
2026-10-29 21:05:29 +00:00
Christian Manivong 4108eb83dd feat: set_hostname renames the host (#45)
driver / test (3.13) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 29s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m14s
CI / driver (pull_request) Successful in 1m15s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m11s
driver / publish (pull_request) Skipped
netOrk could save a Linux host's new name but not apply it: the driver had
no set_hostname(), so apply-hostname answered "The driver linux does not
support set_hostname()".

HostnameMixin.set_hostname() takes a bare name or an FQDN. The short name
goes to hostnamectl, or to /etc/hostname and hostname(1) without systemd.
/etc/hosts follows: every line naming the old name, else the 127.0.1.1
line; a file with neither is left alone. A cloud-init host gets
preserve_hostname: true, or its next boot restores the image's name.
Names that are not RFC 1123 hostnames are refused before anything runs.
Files are staged unprivileged and installed by root
(_install_file_as_root), never written from privileged stdin.

It lives in its own module because linux.py may not grow (quality
ratchet); the two lines it adds there are offset by a stale comment and
an import that fits on one line, so the baseline drops to 2286.
2026-10-29 21:57:40 +01:00
christianmanivong b6677c9fc5 Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#44) from chore/python-312-floor into main
driver / lint (push) Successful in 21s
driver / test (3.13) (push) Successful in 1m9s
driver / lowest (push) Successful in 35s
driver / build (push) Successful in 38s
driver / security (push) Successful in 1m14s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / types (push) Successful in 1m18s
driver / test (3.12) (push) Successful in 1m28s
CI / driver (push) Successful in 2m58s
2026-10-27 09:37:26 +00:00
Christian Manivong 2afdf33d4d chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / test (3.13) (pull_request) Successful in 55s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m42s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m7s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / publish (pull_request) Skipped
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
2026-10-27 10:18:57 +01:00
christianmanivong 661f6da3f7 Merge pull request 'fix: keep systemd's OSC 3008 shell context out of command output (#41)' (#42) from fix/osc-context-41 into main
driver / lint (push) Successful in 17s
driver / test (3.11) (push) Successful in 2m16s
driver / test (3.13) (push) Successful in 46s
driver / lowest (push) Successful in 25s
driver / build (push) Successful in 24s
driver / security (push) Successful in 56s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / test (3.10) (push) Successful in 1m13s
driver / types (push) Successful in 3m1s
driver / test (3.12) (push) Successful in 1m43s
CI / driver (push) Successful in 5m29s
2026-10-23 21:10:04 +00:00
Christian Manivong 42e93f02dd refactor: prepare the interactive shell in its own module
driver / test (3.10) (pull_request) Successful in 3m57s
driver / test (3.11) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 43s
driver / security (pull_request) Successful in 1m3s
driver / build (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 16m1s
CI / driver (pull_request) Successful in 23m9s
driver / standard (pull_request) Successful in 40s
driver / lint (pull_request) Successful in 27s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / types (pull_request) Successful in 19m18s
driver / publish (pull_request) Skipped
The prompt-hook step (#41) pushed linux.py past its line count in the
quality baseline. The three steps that make netmiko's fresh shell fit to
read - history off, prompt hooks off, no line wrap - and the prompt
pattern move to napalm_linux/_shell.py, under strict mypy. linux.py
shrinks below where it was; the baseline follows.
2026-10-23 22:46:36 +02:00
Christian Manivong 4159612a33 fix: keep systemd's OSC 3008 shell context out of command output (#41)
driver / test (3.10) (pull_request) Successful in 1m3s
driver / test (3.11) (pull_request) Successful in 1m4s
driver / test (3.13) (pull_request) Successful in 2m1s
driver / lowest (pull_request) Successful in 1m19s
driver / build (pull_request) Successful in 23s
driver / security (pull_request) Successful in 4m12s
CI / driver (pull_request) Failing after 8m24s
driver / standard (pull_request) Failing after 17s
driver / lint (pull_request) Successful in 28s
driver / types (pull_request) Successful in 51s
driver / test (3.12) (pull_request) Successful in 1m58s
driver / publish (pull_request) Skipped
systemd 258 (Ubuntu 26.04) ships /etc/profile.d/80-systemd-osc-context.sh:
an interactive bash wraps every command in OSC 3008 sequences from PS0 and
PROMPT_COMMAND, each with a fresh UUID. They ended up in every value read
through netmiko's shell, and because the prompt never looked the same twice,
the prompt line stayed in the output too. os_version grew past 255
characters and netOrk could not store the poll.

The session now unsets PS0 and PROMPT_COMMAND right after switching the
history off and reads its prompt anew; _send() strips terminal codes from
what it returns.

Version 0.15.1.
2026-10-23 18:58:21 +02:00
christianmanivong 3aa1955382 Merge pull request 'chore: adopt the NAPALM driver standard' (#38) from chore/driver-standard into main
driver / lint (push) Successful in 16s
driver / test (3.11) (push) Successful in 1m10s
driver / lowest (push) Successful in 30s
driver / test (3.13) (push) Successful in 1m2s
driver / build (push) Successful in 34s
driver / security (push) Successful in 1m15s
driver / publish (push) Successful in 29s
driver / standard (push) Successful in 18s
driver / types (push) Successful in 1m13s
driver / test (3.10) (push) Successful in 1m14s
driver / test (3.12) (push) Successful in 1m8s
CI / driver (push) Successful in 3m46s
v0.15.0
2026-10-23 12:55:55 +00:00
Christian Manivong 9a4bc76dbf chore(release): 0.15.0
driver / test (3.10) (pull_request) Successful in 59s
driver / test (3.11) (pull_request) Successful in 58s
driver / lowest (pull_request) Successful in 29s
driver / test (3.13) (pull_request) Successful in 52s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m42s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 54s
driver / test (3.12) (pull_request) Successful in 56s
driver / publish (pull_request) Skipped
2026-10-23 12:02:11 +02:00
Christian Manivong cc0e0358f2 ci: say which napalm-device-types the git install waits for
driver / test (3.10) (pull_request) Failing after 38s
driver / test (3.11) (pull_request) Failing after 38s
driver / lowest (pull_request) Failing after 19s
driver / security (pull_request) Failing after 46s
driver / build (pull_request) Successful in 23s
CI / driver (pull_request) Failing after 4m55s
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Failing after 41s
driver / test (3.12) (pull_request) Failing after 35s
driver / test (3.13) (pull_request) Failing after 31s
driver / publish (pull_request) Skipped
2026-10-23 08:29:33 +02:00
Christian Manivong e0960085c7 Merge remote-tracking branch 'origin/master' into chore/driver-standard
driver / test (3.10) (pull_request) Failing after 38s
driver / test (3.11) (pull_request) Failing after 38s
driver / lowest (pull_request) Failing after 17s
driver / security (pull_request) Failing after 45s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Failing after 4m51s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Failing after 42s
driver / test (3.12) (pull_request) Failing after 33s
driver / test (3.13) (pull_request) Failing after 30s
driver / publish (pull_request) Skipped
# Conflicts:
#	napalm_linux/linux.py
2026-10-23 08:29:05 +02:00
christianmanivong 91b2025074 Merge pull request 'feat: apt's proxy through AptProxyMixin (NetOrk/netork#1397)' (#39) from feat/apt-proxy-verify into master
CI / test (3.10) (push) Failing after 14s
CI / test (3.11) (push) Failing after 13s
CI / test (3.12) (push) Failing after 14s
2026-10-22 22:08:24 +00:00
Christian Manivong 04f071afd0 feat: apt's proxy through AptProxyMixin (NetOrk/netork#1397)
CI / test (3.10) (push) Failing after 21s
CI / test (3.11) (push) Failing after 19s
CI / test (3.10) (pull_request) Failing after 19s
CI / test (3.12) (pull_request) Failing after 16s
CI / test (3.12) (push) Failing after 18s
CI / test (3.11) (pull_request) Failing after 17s
get_package_proxy() is what apt-config dump says, not 00proxy alone: a
proxy in 90curtin-aptproxy or /etc/apt/apt.conf wins over it and was
missed. The driver now supplies only the transports: reads on the exec
channel, root commands through _root_outcome, the file through the staged
_install_file_as_root. New: get_package_proxy_report() and
check_package_proxy(). configure_package_proxy() also comments out other
proxy lines, reads the result back and fetches through the proxy.

Requires napalm-device-types 4.22.0; version 0.14.0.
2026-10-22 19:16:40 +02:00
Christian Manivong 9b3ac3f3eb chore: adopt the NAPALM driver standard
driver / test (3.10) (pull_request) Failing after 5m48s
driver / test (3.11) (pull_request) Failing after 3m11s
driver / test (3.13) (pull_request) Successful in 4m16s
driver / lowest (pull_request) Successful in 4m47s
driver / security (pull_request) Successful in 6m8s
driver / build (pull_request) Failing after 52s
CI / driver (pull_request) Failing after 30m42s
driver / standard (pull_request) Successful in 56s
driver / lint (pull_request) Successful in 49s
driver / types (pull_request) Failing after 1m6s
driver / test (3.12) (pull_request) Successful in 2m48s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; napalm-device-types comes from git until it is
  on PyPI.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE file,
  py.typed, SPDX license string, links to git.netork.io.
- mypy strict for the package; napalm_linux.linux is exempt for now (21
  errors), recorded in the quality baseline with its long functions and
  the 2200-line module. Coverage floor 58 % (measured 58.23 %).
2026-10-22 19:11:50 +02:00
Christian Manivong 933f81bd44 fix: what bandit and the remaining lint rules found
- Long shell command lines are split into adjacent string literals.
- get_os_users: a first loop over /etc/group filled a map nobody read;
  it is gone, the output is unchanged.
- The five except Exception: pass now log at debug level (B110), so a
  swallowed failure leaves a trace.
- nosec for the staging path on the device (B108) and the sudo hint
  message (B105); both are false positives.
- tests: raise ... from exc, unused loop variable.
2026-10-22 19:10:26 +02:00
Christian Manivong 38391891ec style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
2026-10-22 19:09:42 +02:00
christianmanivong 0ba5081824 Merge pull request 'feat: get_host_firewall, the host's own netfilter rules (NetOrk/netork#1344)' (#37) from feat/host-firewall-1344 into master
CI / test (3.10) (push) Successful in 36s
CI / test (3.11) (push) Successful in 25s
CI / test (3.12) (push) Successful in 27s
2026-10-21 21:26:37 +00:00
Christian Manivong 19b86d103d feat: get_host_firewall, the host's own netfilter rules (NetOrk/netork#1344)
CI / test (3.10) (push) Failing after 15s
CI / test (3.11) (push) Failing after 14s
CI / test (3.10) (pull_request) Failing after 15s
CI / test (3.12) (pull_request) Failing after 16s
CI / test (3.12) (push) Failing after 21s
CI / test (3.11) (pull_request) Failing after 17s
Mixes in napalm-device-types' HostFirewallMixin. The transport runs the shared
read-only command as root on an exec channel: nft prints the whole ruleset as
one line of JSON, longer than the PTY takes reliably, and both nft and
iptables-save need CAP_NET_ADMIN. Requires napalm-device-types 4.21.0;
version 0.13.0.
2026-10-21 23:10:48 +02:00
christianmanivong facc081123 Merge pull request 'feat: get_service_packages, which packages a systemd service is (NetOrk/netork#1236)' (#36) from feat/service-packages-1236 into master
CI / test (3.10) (push) Successful in 38s
CI / test (3.11) (push) Successful in 39s
CI / test (3.12) (push) Successful in 29s
2026-10-19 17:08:12 +00:00
Christian Manivong a2bfa709f9 feat: get_service_packages, which packages a systemd service is (NetOrk/netork#1236)
CI / test (3.10) (pull_request) Successful in 41s
CI / test (3.12) (pull_request) Successful in 32s
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 40s
CI / test (3.12) (push) Successful in 34s
Mixes in napalm-device-types' ServicePackagesMixin. The transport runs the
shared read-only command on an exec channel under sh, without sudo: it is
about 1 kB, past what the PTY takes reliably, and written for sh whatever
the login shell. Requires napalm-device-types 4.20.0; version 0.12.0.
2026-10-19 17:40:06 +02:00
christianmanivong c725f4882c Merge pull request 'fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)' (#35) from fix/ssh-host-key-tofu-1167 into master
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 30s
2026-10-18 19:23:39 +00:00
Christian Manivong 4b17e2f3f8 fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)
CI / test (3.10) (push) Successful in 30s
CI / test (3.11) (push) Successful in 31s
CI / test (3.10) (pull_request) Successful in 40s
CI / test (3.12) (pull_request) Successful in 33s
CI / test (3.12) (push) Successful in 36s
CI / test (3.11) (pull_request) Successful in 31s
The driver accepted any SSH host key. It now verifies through
napalm-device-types' HostKeyCheck (>= 4.19.0): with a known key in
optional_args["ssh_host_keys"] any other key is refused before login, and
every key seen is reported to optional_args["ssh_host_key_observer"].
Without either argument it connects as before (first use).
2026-10-18 21:23:39 +02:00
christianmanivong 5951a6100e Merge pull request 'chore: need napalm-device-types 4.18.0 for the service clusters (0.10.1)' (#34) from chore/0.10.1 into master
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 25s
2026-10-18 13:47:25 +00:00
Christian Manivong 127e3150b4 chore: need napalm-device-types 4.18.0 for the service clusters (0.10.1)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 27s
CI / test (3.11) (pull_request) Successful in 23s
ServiceClustersMixin shipped in napalm-device-types 4.18.0 -- 4.17.0 is the
public contracts release (#46) that happened to share its number with it.
2026-10-18 15:38:36 +02:00
christianmanivong 72f0daa995 Merge pull request 'feat: read the service clusters a host belongs to (0.10.0)' (#33) from feat/service-clusters into master
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 26s
2026-10-18 13:37:24 +00:00
Christian Manivong 427a9ac8af feat: read the service clusters a host belongs to (0.10.0)
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 26s
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 24s
CI / test (3.11) (pull_request) Successful in 24s
CI / test (3.12) (push) Successful in 25s
LinuxDriver mixes in napalm-device-types' ServiceClustersMixin (4.17.0):
get_service_clusters() reads Patroni's members and roles, adguardhome-sync's
origin and replicas and a BunkerWeb worker's manager from the host's own
configuration -- the evidence that two hosts run one service, not merely
answer at one address (NetOrk/netork#1125). _run_service_clusters_command
carries the shared command on an exec channel, root first, like the virtual
IPs' one.
2026-10-18 15:29:02 +02:00
christianmanivong c8e2b328d7 Merge pull request 'feat: report the configured package proxy, not apt_proxy_missing (0.9.0)' (#32) from feat/facts-not-warnings into master
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 25s
2026-10-17 08:34:55 +00:00
Christian Manivong decd64b876 feat!: report the package proxy as a fact; no warnings of its own (0.9.0)
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 32s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 29s
CI / test (3.11) (pull_request) Successful in 23s
get_device_warnings decided two things for the application: that any
pending update is a warning (it re-read the updates for that), and
whether apt's proxy is the one the application's setting wants, which
it was handed as optional_args["apt_proxy_url"].

The driver reports facts instead (napalm-device-types 4.14):
get_package_proxy() says which proxy apt fetches through, None for none
or on a non-apt host; the updates are get_available_updates() as
before. get_device_warnings and the apt_proxy_url argument go.

BREAKING CHANGE: get_device_warnings and optional_args["apt_proxy_url"]
are removed. Requires napalm-device-types 4.14.

Closes #28
2026-10-17 09:20:28 +02:00