Commit Graph
161 Commits
Author SHA1 Message Date
christianmanivong f4354f498e refactor: the SNMP health profile shapes in snmp_health_profile.py
models.py is over the file size limit and may not grow; the unknown
key pushed it past its recorded length. SnmpHealthProfile,
SnmpValueSpec, SnmpMemorySpec and SnmpInterfacesSpec move to
napalm_device_types/snmp_health_profile.py. The package exports them
as before and models re-exports them, so existing imports keep working.
The baseline records the smaller models.py.
2026-11-01 23:05:13 +01:00
christianmanivong 83ea13f88e Merge remote-tracking branch 'origin/main' into feat/health-profile-unknown
# Conflicts:
#	CHANGELOG.md
2026-11-01 23:01:38 +01:00
christianmanivong 9c3be46d8a Merge pull request 'feat: HA state, backups, quorum votes, migrate_vm and node maintenance' (#71) from feat/vm-lifecycle into main
driver / lint (push) Successful in 15s
driver / test (3.13) (push) Successful in 53s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 27s
driver / security (push) Successful in 56s
driver / publish (push) Skipped
driver / types (push) Successful in 58s
driver / test (3.12) (push) Successful in 1m3s
driver / standard (push) Successful in 16s
CI / driver (push) Successful in 2m29s
2026-11-01 21:48:11 +00:00
christianmanivong a6289cb24a feat: HA state, backups, quorum votes, migrate_vm and node maintenance
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Successful in 2m30s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 30s
driver / test (3.13) (pull_request) Successful in 58s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 12s
get_clusters() may also report the cluster's HA resources, backup jobs, the
newest backup per guest and storage, and each node's quorum votes (all
NotRequired; None means not read). HypervisorDriver declares
get_vm_migration_preflight(), migrate_vm() and set_node_maintenance(); the
preflight shape lives in vm_migration.py.

Part of NetOrk/netork#1820 (stage 7: #759, #760, #761).
2026-11-01 22:15:01 +01:00
christianmanivong 9f6ffa8a25 feat(snmp): let a health profile mark a value unknown
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m30s
driver / standard (pull_request) Failing after 15s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 35s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 13s
SnmpValueSpec gains `unknown`. A driver whose device's agent answers a
value wrongly says so in its SNMP_HEALTH_PROFILE, and the application
reports no value for it instead of the standard reading or a default.
OpenBSD's net-snmp reports the CPU as never idle, so a reading of
ssCpuIdle shows every OpenBSD host at 100 % (NAPALM/napalm-bsd#7).
2026-11-01 22:11:19 +01:00
christianmanivong a809e6c02f Merge pull request 'feat: get_clusters() and create_vm_from_cloud_init(node=)' (#68) from feat/cluster-inventory into main
driver / lint (push) Successful in 20s
driver / test (3.13) (push) Successful in 1m21s
driver / lowest (push) Successful in 39s
driver / build (push) Successful in 35s
driver / security (push) Successful in 1m16s
driver / publish (push) Skipped
driver / types (push) Successful in 1m30s
driver / test (3.12) (push) Successful in 1m26s
driver / standard (push) Failing after 7s
CI / driver (push) Failing after 2m49s
2026-11-01 18:41:05 +00:00
christianmanivong 5b894913e1 refactor: the cluster shapes in clusters.py, a shorter provisioning docstring
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m16s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 32s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
models.py is over the file size limit and may not grow, and the declaration
of create_vm_from_cloud_init() may not get longer: the four cluster shapes
move to napalm_device_types/clusters.py (exported from the package as
before), and the docstring says the same in fewer lines.

Refs NetOrk/netork#484
2026-11-01 17:08:10 +01:00
christianmanivong 00aa5efef0 feat: get_clusters() and create_vm_from_cloud_init(node=)
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m0s
CI / driver (pull_request) Failing after 2m32s
driver / lint (pull_request) Successful in 16s
driver / standard (pull_request) Failing after 19s
driver / types (pull_request) Successful in 1m10s
driver / test (3.13) (pull_request) Successful in 1m13s
driver / test (3.12) (pull_request) Successful in 1m19s
driver / lowest (pull_request) Successful in 32s
driver / publish (pull_request) Skipped
A hypervisor reports every cluster its connection can see: the cluster's
name and quorum, its nodes (offline ones too, the local one marked) with
CPU and memory, and the storages and networks with the nodes that see
each. A standalone host is a cluster of one without a name; a manager
reports each cluster and standalone host it runs. Declared only, so a
capability check stays truthful.

create_vm_from_cloud_init() takes the node to create the VM on; a driver
that can only create on its own node refuses another.

Refs NetOrk/netork#484, NetOrk/netork#1822
2026-11-01 16:38:38 +01:00
christianmanivong 97cb8779c5 Merge pull request 'feat: netOrk's own account through the current login (NetOrk/netork#1817)' (#67) from feature/system-user-1817 into main
driver / lint (push) Successful in 15s
driver / test (3.13) (push) Successful in 1m0s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 26s
driver / security (push) Successful in 1m0s
driver / publish (push) Skipped
driver / types (push) Successful in 57s
driver / test (3.12) (push) Successful in 1m6s
driver / standard (push) Successful in 16s
CI / driver (push) Successful in 2m16s
2026-11-01 12:39:41 +00:00
christianmanivong 47751d12d6 fix: another service's account of the same name is left alone (NetOrk/netork#1817)
driver / security (pull_request) Successful in 55s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Successful in 56s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 30s
driver / test (3.12) (pull_request) Successful in 56s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
On bw-01, netork is the satellite's own user (nologin, in docker).
add_service_account opened it, gave it the passwordless sudo rule and netOrk's
key, and only the login as it failed. An account that is there and cannot log
in (nologin, false) is now refused before anything changes.
2026-11-01 13:36:38 +01:00
christianmanivong 3f59023f46 feat: a fixed uid for netOrk's own account (NetOrk/netork#1817)
driver / security (pull_request) Successful in 1m3s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Successful in 1m10s
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / lowest (pull_request) Successful in 31s
driver / test (3.12) (pull_request) Successful in 1m10s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
add_service_account(uid=) makes a new account with that uid once no other
account has it, through the driver's _account_create_with_uid; an account that
is there keeps its own, as a uid is never changed under files that carry it.
The infrastructure's build standard wants the same uid on every host.
2026-11-01 12:42:30 +01:00
christianmanivong 666be091e3 feat: netOrk's own account through the current login (NetOrk/netork#1817)
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Failing after 2m35s
driver / standard (pull_request) Successful in 21s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 50s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Failing after 7s
add_service_account(name, public_key) creates or reopens the account through
the login the driver uses today: a key and no password, and a rule of its own
in 85-service-<name> that lets it run everything as root without a password,
checked with visudo and sudo -l. Root is refused; run again with the account
the driver already logs in with, it only adds what is missing.
2026-11-01 12:03:01 +01:00
christianmanivong 25cc264306 Merge pull request 'fix(apt_proxy): https sources take the http proxy too (NetOrk/netork#1811)' (#64) from fix/apt-https-proxy into main
driver / lint (push) Successful in 15s
driver / test (3.13) (push) Successful in 1m4s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 26s
driver / security (push) Successful in 59s
driver / publish (push) Skipped
driver / types (push) Successful in 1m4s
driver / test (3.12) (push) Successful in 1m10s
driver / standard (push) Successful in 15s
CI / driver (push) Successful in 2m18s
2026-11-01 07:25:56 +00:00
christianmanivong 86959b7599 Merge remote-tracking branch 'origin/main' into fix/apt-https-proxy
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m50s
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / lowest (pull_request) Successful in 33s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 15s
2026-11-01 08:21:18 +01:00
christianmanivong 8664accbc4 Merge pull request 'refactor(ssh_server): split three functions under the standard's line limit (#65)' (#66) from fix/ssh-server-ratchet into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m7s
driver / lowest (push) Successful in 31s
driver / build (push) Successful in 28s
driver / security (push) Successful in 1m16s
driver / publish (push) Skipped
driver / types (push) Successful in 1m1s
driver / test (3.12) (push) Successful in 1m3s
driver / standard (push) Successful in 21s
CI / driver (push) Successful in 2m37s
2026-11-01 07:21:11 +00:00
christianmanivong 449a6b13ca refactor(ssh_server): split three functions under the standard's line limit (#65)
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m9s
driver / standard (pull_request) Successful in 17s
driver / types (pull_request) Successful in 1m18s
driver / test (3.12) (pull_request) Successful in 1m28s
driver / test (3.13) (pull_request) Successful in 1m18s
driver / lowest (pull_request) Successful in 35s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 15s
harden_ssh_server (70), _apply_or_restore (51) and exempt_from_ssh_penalties
(81) had grown past the 50-line limit with #63, and `driver / standard` was
red on main. The reading and planning, the putting back, the session's
address, the reasons to leave the exemption and its write move into methods
of their own. Same behaviour, same tests; harden_ssh_server leaves the
baseline.
2026-11-01 08:17:27 +01:00
christianmanivong c71ddd7fe6 refactor(apt_proxy): smaller parts, under the standard's complexity limit
driver / build (pull_request) Successful in 55s
driver / security (pull_request) Successful in 1m33s
CI / driver (pull_request) Failing after 3m0s
driver / standard (pull_request) Failing after 20s
driver / types (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / lowest (pull_request) Successful in 47s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 17s
The quality ratchet counted _dump, parse_apt_proxy and _https_direct over
complexity 10 (NetOrk/netork#1811). Same behaviour, same tests.
2026-11-01 08:13:20 +01:00
christianmanivong 3b6c5f9585 fix(apt_proxy): https sources take the http proxy too (NetOrk/netork#1811)
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m22s
driver / standard (pull_request) Failing after 18s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 33s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 17s
apt's https method asks Acquire::https::Proxy and then Acquire::http::Proxy,
for the host and then for all. An 00proxy with the http line alone therefore
sent download.docker.com and every other https source to apt-cacher-ng, which
answers 403 CONNECT denied without a PassThroughPattern, and the whole upgrade
failed.

- The report carries https_proxy, https_per_host and https_settings;
  https_proxy_for(report, host) is the proxy apt takes for one https host.
- check_https_source() fetches one https source the way apt does.
- configure_package_proxy gains an https step: one https source through the
  new proxy. Where the proxy refuses it, 00proxy also says
  Acquire::https::Proxy "DIRECT", later https lines to the same proxy are
  commented out, and the source is fetched direct. An HTTP error from the
  mirror counts as let through.
- apt_fetch_command takes https URLs; comment_out_command takes a scheme.
2026-11-01 07:58:05 +01:00
christianmanivong 1c71fe6896 Merge pull request 'feat: LocalAccountsMixin, personal accounts added and locked again (NetOrk/netork#1793)' (#62) from feat/local-accounts into main
driver / lint (push) Successful in 14s
driver / lowest (push) Failing after 5s
driver / test (3.13) (push) Successful in 1m2s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m11s
driver / publish (push) Skipped
driver / test (3.12) (push) Successful in 1m4s
driver / types (push) Successful in 1m6s
driver / standard (push) Failing after 16s
CI / driver (push) Failing after 2m47s
Reviewed-on: #62
2026-10-31 23:45:34 +00:00
christianmanivong 9159106837 Merge remote-tracking branch 'origin/main' into feat/local-accounts
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Failing after 2m35s
driver / standard (pull_request) Failing after 18s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 31s
driver / test (3.13) (pull_request) Successful in 58s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 13s
# Conflicts:
#	CHANGELOG.md
2026-11-01 00:45:06 +01:00
christianmanivong 28ff14589b Merge pull request 'feat: the managing client and sshd's per-source penalties (NetOrk/netork#1800)' (#63) from feat/ssh-penalties-1800 into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 58s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m4s
driver / publish (push) Skipped
driver / types (push) Successful in 1m2s
driver / test (3.12) (push) Successful in 1m4s
driver / standard (push) Failing after 17s
CI / driver (push) Failing after 2m21s
Reviewed-on: #63
2026-10-31 23:29:09 +00:00
christianmanivong 5fffb3b886 feat: the managing client and sshd's per-source penalties (NetOrk/netork#1800)
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Failing after 2m24s
driver / standard (pull_request) Failing after 9s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m11s
driver / test (3.13) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 33s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 22s
OpenSSH 9.8+ penalises a source whose connections do not authenticate --
a scanner's probes -- and then drops every connection from it, the
managing client's included.

- OpenSshServerMixin.exempt_from_ssh_penalties puts the address the host
  sees the client at ($SSH_CONNECTION) into PerSourcePenaltyExemptList,
  next to the host's own exemptions, in its own drop-in. Only where sshd
  has the penalties (an older one refuses the directive) and includes the
  drop-in directory; checked with sshd -t, sshd -T and a new session, and
  taken back on any failure. The check-and-restore step of
  harden_ssh_server is shared for it.
- retry_refused tries a connection again after 1, 3, 7 and 15 s while
  sshd closes it before its banner; HostKeyCheck.connect uses it.
2026-11-01 00:24:11 +01:00
christianmanivong 2846824a21 feat: a host may add a key file sshd reads (NetOrk/netork#1793)
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 2m45s
driver / standard (pull_request) Successful in 17s
driver / types (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / lowest (pull_request) Successful in 39s
driver / test (3.13) (pull_request) Successful in 1m23s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
_account_key_files says which files hold an account's keys; the default is
~/.ssh/authorized_keys and authorized_keys2. OpenMediaVault adds the file it
deploys under /var/lib/openmediavault/ssh/authorized_keys, so reading an
account back sees every key sshd would take.
2026-10-31 23:31:05 +01:00
christianmanivong 0545d1d814 feat: a driver may keep the account keys elsewhere (NetOrk/netork#1793)
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 2m44s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m6s
driver / test (3.13) (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
OpenMediaVault keeps a user's keys in its own database and deploys them
to /var/lib/openmediavault/ssh/authorized_keys, and creates a home only
when its home directory setting is on. The key store becomes three hooks
with the ~/.ssh default: _account_read_keys, _account_add_key and
_account_remove_keys, each given the account's home.
2026-10-31 23:29:46 +01:00
christianmanivong 49c65cbd5d feat: LocalAccountsMixin, personal accounts added and locked again (NetOrk/netork#1793)
driver / build (pull_request) Successful in 36s
driver / security (pull_request) Successful in 1m21s
CI / driver (pull_request) Successful in 3m6s
driver / standard (pull_request) Successful in 25s
driver / types (pull_request) Successful in 1m36s
driver / test (3.13) (pull_request) Successful in 1m15s
driver / test (3.12) (pull_request) Successful in 1m41s
driver / lowest (pull_request) Successful in 46s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 30s
get_local_accounts(names) reads a person's account back: groups, lock,
sudo, key files. add_local_account() creates or reopens one with the
person's key, optional password hash and optional sudo rule;
lock_local_account() takes the keys and sudo away and refuses every
login, keeping the home.

Every command root runs is one fixed command, so a sudoers allowlist can
name it. The key files are read and written as the person (sudo -n -u),
never as root, since a link in a home the person owns may point anywhere.
The sudo rule is a drop-in of its own, checked with visudo before and
sudo -l after; a rule elsewhere (cloud-init's) is reported, not edited.
The login user's own account and system accounts are refused.

A driver supplies creating, opening, locking, reading the lock and
leaving a group.
2026-10-31 23:24:27 +01:00
christianmanivong 888a7229dc Merge pull request 'feat: SudoHistoryMixin, the sudo password left in shell histories (NetOrk/netork#1090)' (#60) from feat/sudo-history-cleanup into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 1m3s
driver / lowest (push) Successful in 32s
driver / build (push) Successful in 34s
driver / security (push) Successful in 1m5s
driver / publish (push) Skipped
driver / types (push) Successful in 1m1s
driver / test (3.12) (push) Successful in 1m10s
driver / standard (push) Successful in 17s
CI / driver (push) Successful in 2m25s
2026-10-30 20:47:48 +00:00
christianmanivong 0f0064c2d7 test: the fake host never answers with this machine's uid
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m32s
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / test (3.13) (pull_request) Successful in 1m16s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
CI runs as root, which the owner step skips, so three owner tests failed there
while they passed for a normal user.
2026-10-30 21:44:40 +01:00
christianmanivong cb90fa9835 feat: SudoHistoryMixin, the sudo password left in shell histories (NetOrk/netork#1090)
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Failing after 2m24s
driver / standard (pull_request) Failing after 7s
driver / types (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / test (3.13) (pull_request) Failing after 1m3s
driver / lowest (pull_request) Failing after 33s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 20s
A driver that typed `echo '<password>' | sudo -S -p "" <command>` into an
interactive shell left that line, password and all, in the login user's
shell history once per command, and where only the part before the first
`&&` ran as root, files root should own were left to the login user.

get_history_sudo_lines() counts the lines per history file with grep -c,
as the login user, without reading any back. remove_history_sudo_lines()
deletes exactly those lines with sed -i, overwrites the backup with
shred -u, and as root gives the driver's SUDO_ROOT_FILES back to root:root
where each is a regular file, not a link, owned by the login user. It
reports each file's lines before and after. Nothing goes to stdin.

The driver names the marker and the files and supplies run_command.
2026-10-30 21:09:24 +01:00
christianmanivong 551ed0a29d Merge pull request 'feat: NetworkTargetDict.uplinks, the NICs a bridge leaves through (NetOrk/netork#1325)' (#58) from feat/network-target-uplinks into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 1m8s
driver / lowest (push) Successful in 31s
driver / build (push) Successful in 32s
driver / security (push) Successful in 1m8s
driver / publish (push) Skipped
driver / types (push) Successful in 1m3s
driver / test (3.12) (push) Successful in 1m16s
driver / standard (push) Successful in 18s
CI / driver (push) Successful in 2m34s
2026-10-30 09:54:19 +00:00
christianmanivong 0dc1a598e2 Merge remote-tracking branch 'origin/main' into feat/network-target-uplinks
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 3m1s
driver / standard (pull_request) Successful in 24s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / lowest (pull_request) Successful in 32s
driver / test (3.13) (pull_request) Successful in 59s
driver / publish (pull_request) Skipped
# Conflicts:
#	CHANGELOG.md
2026-10-30 10:20:48 +01:00
christianmanivong 131346c228 Merge pull request 'feat: ARP_AGE_UNKNOWN, the age of a neighbour the device does not report' (#57) from fix/arp-unknown-age into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m7s
driver / lowest (push) Successful in 33s
driver / build (push) Successful in 42s
driver / security (push) Successful in 1m16s
driver / publish (push) Skipped
driver / types (push) Successful in 1m5s
driver / test (3.12) (push) Successful in 1m12s
driver / standard (push) Successful in 19s
CI / driver (push) Successful in 3m5s
2026-10-30 09:20:21 +00:00
christianmanivong a5b7b540c6 feat: NetworkTargetDict.uplinks, the NICs a bridge leaves through (NetOrk/netork#1325)
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m12s
CI / driver (pull_request) Successful in 2m47s
driver / standard (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 36s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
A VM on a VLAN-aware bridge without a VLAN tag only gets an address when
the switch port behind the bridge carries an untagged network. To find
that port, the caller needs the bridge's physical NICs: their LLDP
neighbours name the switch and the port.

uplinks lists them in groups, one per way out of the bridge: a bond's
slaves together, a single NIC alone. A bond is one link, so a caller can
let one slave's neighbour speak for the others when lldpd sees only one.
Internal, VLAN and virtual ports are no uplinks. A missing key means the
driver cannot tell; an empty list is a bridge without uplink.
2026-10-30 09:27:23 +01:00
christianmanivong 874c6c5a92 feat: ARP_AGE_UNKNOWN, the age of a neighbour the device does not report
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Successful in 3m3s
driver / standard (pull_request) Successful in 17s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 31s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 18s
NAPALM requires an age on every entry of get_arp_table and
get_ipv6_neighbors_table. Many devices do not report one, and drivers
filled in 0.0, which means "confirmed just now". ARP_AGE_UNKNOWN (-1.0, as
NAPALM's IOS driver reports) is the value for "not reported"; the README
states the contract.

NetOrk/netork#1327
2026-10-30 08:37:08 +01:00
christianmanivong 145c2c668b Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#56) from chore/python-312-floor into main
driver / lint (push) Successful in 13s
driver / test (3.13) (push) Successful in 57s
driver / lowest (push) Successful in 30s
driver / build (push) Successful in 27s
driver / security (push) Successful in 59s
driver / publish (push) Skipped
driver / types (push) Successful in 55s
driver / test (3.12) (push) Successful in 58s
driver / standard (push) Successful in 17s
CI / driver (push) Successful in 2m25s
2026-10-27 10:19:37 +00:00
Christian Manivong 1cef3385e8 fix: the floor on napalm is 5.1 (NAPALM/driver-standard#6)
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Successful in 2m49s
driver / standard (pull_request) Successful in 21s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 55s
driver / lowest (pull_request) Successful in 28s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
napalm 5.0 and older import pkg_resources, which a Python 3.12 venv no
longer has, so the lowest job failed on them.
2026-10-27 10:49:27 +01:00
Christian Manivong fbd3cf0129 chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Failing after 2m50s
driver / standard (pull_request) Successful in 21s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m2s
driver / lowest (pull_request) Failing after 30s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 14s
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:55 +01:00
christianmanivong e400c4359c Merge pull request 'feat: shutdown_host and begin_stop_vm, shutting down without waiting' (#55) from feat/shutdown-requests into main
driver / lint (push) Successful in 14s
driver / test (3.11) (push) Successful in 1m21s
driver / lowest (push) Successful in 34s
driver / test (3.13) (push) Successful in 1m7s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m9s
driver / publish (push) Skipped
driver / types (push) Successful in 1m25s
driver / test (3.12) (push) Successful in 1m22s
driver / standard (push) Successful in 15s
driver / test (3.10) (push) Successful in 1m23s
CI / driver (push) Successful in 3m20s
2026-10-27 07:41:23 +00:00
christianmanivong 4d3574cd60 feat: shutdown_host and begin_stop_vm, shutting down without waiting
driver / test (3.10) (pull_request) Failing after 6s
driver / test (3.11) (pull_request) Successful in 1m13s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Failing after 2m41s
driver / standard (pull_request) Successful in 20s
driver / types (pull_request) Successful in 1m4s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / lowest (pull_request) Successful in 43s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 18s
HostShutdownMixin.shutdown_host(), on DeviceTypeDriver: a device shuts
itself down cleanly through its own means; declared, so hasattr says
whether a driver can. There is no forced variant.

VmStopRequestMixin.begin_stop_vm(name): ask for a VM's clean shutdown
and return at once, for a caller that waits on a timer and reads
get_vm_status instead of blocking in stop_vm. No role demands it.

For netOrk's graph workflows, which switch a hypervisor off when CI has
nothing for it (NetOrk/netork#1636).
2026-10-27 00:36:54 +01:00
christianmanivong 87dbdfac66 Merge pull request 'feat: AptProxyMixin, what apt fetches through and pointing it at a proxy (NetOrk/netork#1397)' (#53) from feat/apt-proxy-verify into main
driver / lint (push) Successful in 12s
driver / test (3.11) (push) Successful in 53s
driver / lowest (push) Successful in 33s
driver / test (3.13) (push) Successful in 48s
driver / build (push) Successful in 25s
driver / security (push) Successful in 52s
driver / publish (push) Successful in 26s
driver / types (push) Successful in 48s
driver / test (3.12) (push) Successful in 56s
driver / standard (push) Successful in 16s
driver / test (3.10) (push) Successful in 55s
CI / driver (push) Successful in 43m47s
v4.22.0
2026-10-23 10:01:40 +00:00
christianmanivong a07ced2df6 Merge branch 'main' into feat/apt-proxy-verify
driver / test (3.10) (pull_request) Successful in 50s
driver / test (3.11) (pull_request) Successful in 48s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 23s
CI / driver (pull_request) Successful in 7m2s
driver / standard (pull_request) Successful in 13s
driver / types (pull_request) Successful in 44s
driver / test (3.12) (pull_request) Successful in 48s
driver / test (3.13) (pull_request) Successful in 41s
driver / lowest (pull_request) Successful in 24s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 1m24s
The NAPALM driver standard landed on main (#52, 4.21.1). apt_proxy follows
it: builtin generics, strict mypy, complexity 10 at most (parse_apt_proxy,
same_proxy_url and the comment-out step split into helpers), 100 % covered.
Its TypedDicts live in apt_proxy.py, since models.py is over 1000 lines and
may not grow. Version 4.22.0 with its CHANGELOG section.
2026-10-23 00:14:59 +02:00
christianmanivong 22e4377c2b Merge pull request 'chore: adopt the NAPALM driver standard (pilot)' (#52) from chore/driver-standard into main
driver / lint (push) Successful in 11s
driver / test (3.11) (push) Successful in 48s
driver / test (3.13) (push) Successful in 56s
driver / lowest (push) Successful in 36s
driver / security (push) Successful in 55s
driver / build (push) Successful in 26s
driver / publish (push) Skipped
driver / types (push) Successful in 43s
driver / test (3.12) (push) Successful in 49s
driver / standard (push) Successful in 13s
driver / test (3.10) (push) Successful in 51s
CI / driver (push) Successful in 6m28s
v4.21.1
2026-10-22 22:08:14 +00:00
christianmanivong 49830671c9 chore(release): 4.21.1
driver / test (3.10) (pull_request) Successful in 3m3s
driver / test (3.11) (pull_request) Successful in 49s
driver / security (pull_request) Successful in 3m10s
driver / build (pull_request) Successful in 4m38s
CI / driver (pull_request) Successful in 21m52s
driver / standard (pull_request) Successful in 36s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m53s
driver / test (3.13) (pull_request) Successful in 4m52s
driver / lowest (pull_request) Successful in 26s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 1m12s
2026-10-22 21:12:28 +02:00
christianmanivong d7ec558933 feat: AptProxyMixin, what apt fetches through and pointing it at a proxy (NetOrk/netork#1397)
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 30s
CI / test (3.13) (push) Successful in 33s
CI / test (3.10) (pull_request) Successful in 30s
CI / test (3.12) (pull_request) Successful in 29s
CI / test (3.13) (pull_request) Successful in 29s
CI / test (3.12) (push) Successful in 30s
CI / test (3.11) (pull_request) Successful in 28s
apt reads apt.conf.d in order and apt.conf last; the last value wins. The
Debian installer writes its proxy into apt.conf, Ubuntu's into
90curtin-aptproxy: reading 00proxy alone missed both, and a fix that wrote
00proxy and read it back reported success while apt fetched elsewhere.

- get_package_proxy_report(): apt-config dump's proxy, per-host overrides,
  auto-detect, every line of apt's files that sets it (in reading order,
  editable or inside a block), the http and https sources.
- check_package_proxy(url, expect): a fetch with apt-helper, past any proxy;
  an HTTP error counts as an answer.
- configure_package_proxy(url): write 00proxy, comment out other proxy
  lines, read apt's proxy back, fetch one InRelease through it.
- same_proxy_url(): scheme, host and port, a trailing slash aside.

A driver supplies _run_apt_command, _run_apt_root_command and
_write_apt_file. Version 4.22.0.
2026-10-22 19:16:40 +02:00
christianmanivong 0475184684 chore: adopt the NAPALM driver standard
driver / test (3.10) (pull_request) Successful in 1m43s
driver / test (3.11) (pull_request) Failing after 9m18s
driver / security (pull_request) Failing after 4m33s
driver / build (pull_request) Failing after 1m29s
CI / driver (pull_request) Failing after 24m6s
driver / standard (pull_request) Successful in 54s
driver / lint (pull_request) Successful in 50s
driver / types (pull_request) Failing after 1m17s
driver / test (3.12) (pull_request) Failing after 1m20s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Failing after 1m38s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard: conformance, ruff, strict mypy, tests on
  3.10-3.13 and at the lowest declared versions, bandit, pip-audit, build,
  and on a release tag the upload to PyPI.
- tests/quality_baseline.json records today's long and complex functions
  and the one file over 1000 lines; they may shrink, not grow.
- Coverage floor 95 % (measured 95.15 %).
- CHANGELOG.md starts here; project links point at git.netork.io; the
  license is the SPDX string PEP 639 wants.
2026-10-22 19:06:19 +02:00
christianmanivong b7350a9b2c fix: what bandit and the remaining lint rules found
- Long docstring and command lines are wrapped; recorded device output in
  tests/ keeps its lines (E501 is off there).
- host_firewall: the negation token is the named constant _NEGATION. bandit
  read token == "!" as a hardcoded password.
- ssh_host_keys: _known_hosts_file takes the expected key as an argument
  instead of asserting it; both callers had already returned when it is None.
- ssh_server: the staged path is on the device, not a local temp file
  (nosec B108).
- tests: raise ... from exc, zip(strict=True).
2026-10-22 19:05:11 +02:00
christianmanivong 08296d0d2e 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). typing.List/Dict/Optional
become builtin generics and X | None, imports are sorted, the coding cookies
are gone. Two tests that read the source text follow the new spelling.

What ruff cannot fix comes in the next commit.
2026-10-22 19:03:21 +02:00
christianmanivong ac8e7c4c11 Merge pull request 'feat: HostFirewallMixin, a Linux host's own netfilter rules (NetOrk/netork#1344)' (#51) from feat/host-firewall-1344 into main
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 28s
CI / test (3.13) (push) Successful in 25s
CI / test (3.12) (push) Successful in 38s
2026-10-21 21:26:36 +00:00
christianmanivong f77091c489 feat: HostFirewallMixin, a Linux host's own netfilter rules (NetOrk/netork#1344)
CI / test (3.10) (push) Successful in 40s
CI / test (3.11) (push) Successful in 25s
CI / test (3.13) (push) Successful in 51s
CI / test (3.10) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.13) (pull_request) Successful in 25s
CI / test (3.12) (push) Successful in 25s
CI / test (3.11) (pull_request) Successful in 26s
get_host_firewall() reads `nft -j list ruleset` as root and returns every
chain with its family, table, hook, priority and policy, and every rule as
matches and a verdict. Rules iptables-nft wrote show their extensions in nft's
JSON only as an opaque `xt`, so the tables iptables manages are taken from
iptables-save instead; a legacy iptables is kept beside nft's tables, since
both apply. A condition the parse does not model is an `unknown` match with
its text, never left out. Without root neither tool can be read, and
HostFirewallUnavailable is raised rather than a host without rules.

A driver supplies only _run_host_firewall_command(command, privileged=).
Version 4.21.0.
2026-10-21 23:10:44 +02:00
christianmanivong be3958e561 Merge pull request 'feat: ServicePackagesMixin, which packages a systemd service is (NetOrk/netork#1236)' (#50) from feat/service-packages-1236 into main
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 28s
CI / test (3.13) (push) Successful in 36s
CI / test (3.12) (push) Successful in 36s
2026-10-19 16:56:15 +00:00
christianmanivong a21e365c4e fix: annotate the unit path set so mypy accepts service_packages (NetOrk/netork#1236)
CI / test (3.10) (push) Successful in 44s
CI / test (3.11) (push) Successful in 33s
CI / test (3.13) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 42s
CI / test (3.12) (pull_request) Successful in 38s
CI / test (3.13) (pull_request) Successful in 35s
CI / test (3.12) (push) Successful in 32s
CI / test (3.11) (pull_request) Successful in 43s
2026-10-19 18:50:41 +02:00