Files
napalm-device-types/CHANGELOG.md
T
christianmanivong 516fb18c0e
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 15s
driver / test (3.13) (pull_request) Successful in 1m14s
driver / types (pull_request) Failing after 1m35s
driver / test (3.12) (pull_request) Successful in 1m27s
driver / lowest (pull_request) Successful in 34s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Failing after 2m34s
driver / publish (pull_request) Skipped
Merge remote-tracking branch 'origin/main' into feat/tls-fingerprint-tofu
# Conflicts:
#	CHANGELOG.md
2026-11-02 00:06:53 +01:00

185 lines
12 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog
All notable changes to napalm-device-types. The format follows
[Keep a Changelog](https://keepachangelog.com/), versions follow
[Semantic Versioning](https://semver.org/). Versions up to 4.21.0 were not
recorded here; their history is the git log.
## [Unreleased]
### Changed
- Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver
on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6).
- The floor on napalm is 5.1: older releases import `pkg_resources`, which a Python
3.12 venv no longer has.
- `requests` is a declared dependency (floor 2.25.0), for `tls_certificates`; it came
with napalm before.
- The SNMP health profile shapes (`SnmpHealthProfile`, `SnmpValueSpec`,
`SnmpMemorySpec`, `SnmpInterfacesSpec`) are defined in
`napalm_device_types.snmp_health_profile`. The package and `models` still export
them, so an existing import keeps working.
### Added
- `HypervisorDriver.get_vm_migration_preflight(name)`, `migrate_vm(name, target_node,
online=True, target_storage=None, timeout=3600)` and `set_node_maintenance(node,
enabled)`: which nodes of its cluster a guest could move to and what blocks it
(`MigrationPreflightDict`: `allowed_nodes`, `refused_nodes` with the platform's
reason, `local_disks` the migration copies, `local_resources` that block it), the
move itself, blocking until the platform's task ended and raising with the
platform's own cause, and a node's HA maintenance mode. Declared only; netOrk
probes each with `hasattr`.
- `get_clusters()` may report HA, backups and quorum votes: `ClusterDict.ha_resources`
(`HAResourceDict`: requested and current state, node, PVE 8 group, PVE 9 rules),
`backup_jobs` (`BackupJobDict`: schedule, storage, mode, the guests a job covers)
and `backups` (`BackupDict`: per guest and storage the newest backup, its size
and how many there are), and `ClusterNodeDict.votes`. All `NotRequired`, so
drivers written before stay valid; None means could not be read, `[]` read and
empty.
- `napalm_device_types.tls_certificates`: TLS certificates by trust on first use, the
counterpart of `ssh_host_keys` for a driver's HTTPS API. A driver takes the
fingerprint to expect from `optional_args["tls_fingerprints"]` (by port, the SHA-256
of the DER certificate, `SHA256:AB:CD:…`) and refuses any other certificate with
`TlsCertificateMismatch` (a `ConnectionException` naming both fingerprints) before a
password is sent; no CA is consulted, so a self-signed certificate verifies. Without
a fingerprint the first certificate is accepted. Every certificate seen goes to
`optional_args["tls_certificate_observer"]`. `CertificateCheck.verify_server()`
checks the certificate in a handshake of its own, `pin(session)` makes every later
connection of a `requests` session present the same one, `refusing()` turns a refusal
there into the mismatch, `observe()` reports it once the login stands
(NAPALM/napalm-hpe-aruba-procurve#17).
- `LldpAgentMixin.configure_lldp_agent(interfaces)` (`napalm_device_types.fixes`): run
an LLDP agent on the interfaces the caller names. The template installs the agent
(`ensure_package(LLDP_AGENT_PACKAGE)`), has the driver write the interface list
(`_write_lldp_agent_config`), then enables and restarts the service
(`manage_service(LLDP_AGENT_SERVICE, …)`); both names default to `lldpd`. No
interface is a ValueError before anything changes. It is the action for what LLDP
getters used to do on their own (NAPALM/napalm-openwrt#8).
- `SnmpValueSpec.unknown`: a driver whose device's agent answers a value wrongly says
so in its `SNMP_HEALTH_PROFILE` (`"cpu": {"unknown": True}`), and the application
reports no value for it -- not the standard reading, not 0. OpenBSD's net-snmp,
which reports the CPU as never idle, is the case (NAPALM/napalm-bsd#7).
- `VMProvisionIncomplete` (`napalm_device_types.provisioning`): what
`create_vm_from_cloud_init` raises when it fails after the VM was created. A
`RuntimeError` with the failure as its cause and the half-built VM's `vmid` and
`node`, so the caller can remove it with `destroy_vm` (NAPALM/napalm-proxmox#28).
- `HypervisorDriver.get_clusters()` and its shapes `ClusterDict`, `ClusterNodeDict`,
`ClusterStorageDict`, `ClusterNetworkDict`: every cluster the connection can see,
with its nodes (offline ones included, `local` on the node the connection is),
their CPU and memory, and the storages and networks with the nodes that see each.
A standalone host is a cluster of one with no name; a manager reports each cluster
and standalone host it runs. Declared only (NetOrk/netork#484, #1821).
- `create_vm_from_cloud_init(node=…)`: the cluster node to create the VM on. None
leaves it to the driver; a driver that can only create on its own node raises
ValueError for another (NetOrk/netork#1822).
- `LocalAccountsMixin.add_service_account(name, public_key)`: netOrk's own account,
created through the account the driver logs in with today. It takes a key and no
password, and a rule of its own in `85-service-<name>` lets it run everything as
root without a password (`NOPASSWD: ALL`, checked with `visudo` and `sudo -l`). An
account that is there is opened again and keeps its other keys; root is refused
(NetOrk/netork#1817). With `uid=`, a new account gets that uid once no other account
has it; one that is there keeps its own. A driver supplies
`_account_create_with_uid`. An account that is there and cannot log in (`nologin`,
`false`) is another service's, such as a netOrk satellite's `netork`, and is refused
before anything changes.
- `LocalAccountsMixin` (`napalm_device_types.local_accounts`): personal login accounts
on a host. `get_local_accounts(names)` reads them back (groups, lock, sudo, key
files), `add_local_account(name, public_key, password_hash=, admin=)` creates or
reopens one, `lock_local_account(name)` takes its keys and sudo away and refuses
every login while keeping its home. Every command root runs is one fixed command,
the key files are read and written as the account itself, and the sudo rule is a
drop-in of its own, checked with `visudo` and `sudo -l`. A driver supplies the
commands that create, open and lock an account and take it out of a group, and may
replace where the keys are kept (`_account_key_files`, `_account_read_keys`,
`_account_add_key`, `_account_remove_keys`; default `~/.ssh/authorized_keys`)
(NetOrk/netork#1793).
- `OpenSshServerMixin.exempt_from_ssh_penalties`: puts the address the host sees
the managing client at (`$SSH_CONNECTION`) into `PerSourcePenaltyExemptList`,
in `/etc/ssh/sshd_config.d/00-netork-penalty-exempt.conf`, next to the host's
own exemptions. Only where sshd has per-source penalties (OpenSSH 9.8+; an older
one refuses the directive) and sshd_config includes the drop-in directory;
checked with `sshd -t` and `sshd -T`, then a new session, and taken back on any
failure. Helpers: `parse_penalty_exemptions`, `client_address`, `is_exempt`
(NetOrk/netork#1800).
- `retry_refused` and `refused_before_banner` (`napalm_device_types.ssh_host_keys`):
a connection sshd closes before its banner -- what OpenSSH 9.8+ does to a source
it has just penalised -- is tried again after 1, 3, 7 and 15 s.
`HostKeyCheck.connect` does so itself (NetOrk/netork#1800).
- `ARP_AGE_UNKNOWN` (`napalm_device_types.arp`, `-1.0`): the `age` a driver reports
in `get_arp_table` and `get_ipv6_neighbors_table` when the device does not say how
old an entry is. `0.0` means "confirmed just now" and is no stand-in for it
(NetOrk/netork#1327).
- `NetworkTargetDict.uplinks` (optional): the physical NICs a bridge leaves the
host through, one group per way out -- a bond's slaves together, a single NIC
alone (`[["eno1", "eno2"]]`). A missing key means unknown, an empty list a
bridge without uplink. NetOrk follows their LLDP neighbours to the switch port
and its untagged VLAN; one slave's neighbour speaks for its bond
(NetOrk/netork#1325).
- `HostShutdownMixin.shutdown_host()`, on `DeviceTypeDriver`: shut the device itself
down cleanly through its own means; declared, so `hasattr` says whether a driver
can. No forced variant (NetOrk/netork#1636).
- `VmStopRequestMixin.begin_stop_vm(name)`: ask for a VM's clean shutdown and return
at once, for callers that wait on a timer instead of in `stop_vm`. No role demands
it (NetOrk/netork#1636).
- `SudoHistoryMixin` (`napalm_device_types.sudo_history`): the sudo password an earlier
driver typed into an interactive shell (`echo '<password>' | sudo -S -p "" …`) and
left in the login user's shell history, for a driver to mix in (NetOrk/netork#1090).
The driver says what its lines carry (`SUDO_HISTORY_MARKER`) and which files its
partial sudo left to the login user (`SUDO_ROOT_FILES`), and supplies `run_command`.
- `get_history_sudo_lines()` counts the lines per history file (`~/.bash_history`,
`~/.zsh_history`, `~/.ash_history`, `~/.sh_history`) with `grep -c` as the login
user. No line is read back; a file it cannot read raises.
- `remove_history_sudo_lines()` deletes exactly those lines as the login user (`sed
-i`, its backup overwritten with `shred -u`), and as root gives each of
`SUDO_ROOT_FILES` back to `root:root` where it is a regular file, not a symbolic
link, owned by the login user. It reports every file's lines before and after,
how many were removed and which files are root's again. Nothing goes to stdin.
### Fixed
- `AptProxyMixin` knows that apt's https sources take the http proxy too: 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 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 (NetOrk/netork#1811).
- 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's `InRelease` the way apt does;
None where no https source goes through a proxy.
- `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; `direct` sets the host's https setting too.
- `comment_out_command(..., scheme="https")`.
## [4.22.0] - 2026-10-23
### Added
- `AptProxyMixin` (`napalm_device_types.apt_proxy`): apt's proxy on a
Debian-family host, for a driver to mix in (NetOrk/netork#1397).
- `get_package_proxy()` is the proxy apt really fetches through, as
`apt-config dump` says, and no longer the content of one file. A proxy the
Debian or Ubuntu installer set elsewhere wins over `00proxy`, and was missed.
- `get_package_proxy_report()` adds where it is set: every line of apt's
configuration that sets it, in the order apt reads them, the per-host
proxies, and the sources fetched over http and over https.
- `check_package_proxy(url, expect)` fetches a page from the host with apt's
own downloader, past any proxy, and says whether the host reached it and
whether the page says what you expected.
- `configure_package_proxy(url)` writes the proxy, comments out every other
line that sets a different one, reads the result back and fetches one
source through the proxy. It fails when apt still fetches elsewhere.
- `same_proxy_url()` compares two proxy URLs by scheme, host and port.
## [4.21.1] - 2026-10-22
The first release on PyPI since 0.1.0.
### Changed
- The package follows the NAPALM driver standard
(https://git.netork.io/NAPALM/driver-standard): CI on Gitea runs ruff, strict
mypy, the tests on Python 3.10–3.13 and at the lowest declared versions,
bandit, pip-audit and a build check, and a release tag publishes to PyPI.
- Type annotations use builtin generics (`list[str]`, `X | None`) instead of
`typing.List` and `Optional`. They mean the same to a type checker.
- The project links point at git.netork.io instead of GitHub.