napalm-device-types 4.29.0 lets remove_local_account_keys clear the password and sudo too (NetOrk/netork#2033). This driver's _account_clear_password already does the work; a test pins the commands, and the floor rises to 4.29.0.
napalm-device-types 4.28.0 lets add_local_account remove the old keys
(replaces) and adds remove_local_account_keys. OMV keeps a user's keys
in its own database and deploys them where the person cannot write, so
the mixin's key files alone would leave the old key deployed. The keys
go through UserMgmt.setUser, applying only what that made dirty, and
then out of ~/.ssh. Clearing the password is napalm-linux 0.17.0's.
See NetOrk/netork#2013
OMV's generated sshd_config includes /etc/ssh/sshd_config.d, and its salt
state manages only sshd_config itself, so the drop-in napalm-linux's
hardening writes survives the next apply of the SSH settings. The opt-out
from #3 goes; SSHD_CONFIG_GENERATED (napalm-device-types 4.26.0) keeps the
hardening off sshd_config itself.
OpenMediaVault writes several cron files itself, from its own database,
and writes them again on every apply: an edit napalm-linux made there
would be taken back without a word. So every file OMV generates
(/etc/cron.d/openmediavault-*, the mail-queue flush, apticron and the
recycle-bin cleanup) is platform and only runs; the inherited writers
refuse it.
The web UI's "Scheduled Jobs" and the power-management schedule live in
conf.system.cron.job. They are read through Cron.getList, disabled ones
included, instead of the lines OMV generates for them, and switched with
Cron.set, run with Cron.execute (followed through Exec.getOutput), made
with Cron.set and removed with Cron.delete. An application's job on OMV is
an OMV job, visible in its web UI, marked by its comment. Each write
applies the cron module alone, so changes pending in the web UI for other
modules stay pending. Every other job keeps napalm-linux's behaviour.
Requires napalm-device-types 4.26.0 and napalm-linux 0.16.0.
Closes#18
get_disks swallowed a failed or garbled lsblk and returned [], the
answer for a NAS without disks, so every disk vanished on a transient
error. It now raises CommandErrorException; a failed /proc/mdstat read
raises too instead of dropping every pool.
A smartctl call that timed out, was refused by sudo or could not open
the device was logged at debug level and read like a disk without
SMART. It is now logged as a warning with the reason (exit status bits
0 and 1; the disk-state bits 2-7 are not a failed call).
A disk whose verdict passed but that counts reallocated, pending or
offline-uncorrectable sectors (ATA), grown defects (SAS), or sets a
critical warning or counts media errors (NVMe) is reported as
"warning", as the contract allows.
get_disks shrinks below its baseline entries, which are tightened.
Closes#16
A SCSI/SAS disk prints its temperature as "Current Drive Temperature:
28 C", which matched none of the ATA and NVMe patterns, so every SAS
disk read -1. Found in the smartctl output recorded from a Proxmox host.
A QEMU disk without a sensor prints 0 C there and keeps reading -1.
The get_disks tests ran against hand-written smartctl sections. They now
read smartctl -iHA as recorded on real hosts: an ATA SATA DOM and an
NVMe SSD (PASSED), a SAS SSD (OK) and a QEMU disk without SMART, with
serial numbers, WWNs and LU ids replaced. The failing verdicts replace
the verdict line of a recording, as no failing disk was at hand. A
recorded /proc/mdstat without arrays is added too.
get_disks ran smartctl -iA, and neither -i nor -A prints the overall
verdict: only -H does. A disk read unknown, and an ATA disk read failed
from the WHEN_FAILED column header of its attribute table. It now asks
-iHA and reads the verdict line (ATA/NVMe) or SCSI health status only.
Array membership matched the disk name as a substring of the mdstat
line, so sda joined the array of sdaa1. A disk now owns only itself and
its partitions, and /proc/mdstat is read once per call.
Closes#4
Its keys go through UserMgmt, which knows only the users it made, and whether
setUser takes a uid is untested: _account_create_with_uid raises
NotImplementedError, so the switch fails and says why.
napalm-linux adds and locks accounts with shadow-utils and keys in ~/.ssh.
OMV's sshd lets in only root and _ssh, and OMV keeps a user's keys in its
own database, deploying them to /var/lib/openmediavault/ssh/authorized_keys.
So a new account is made by UserMgmt.setUser in _ssh, one made outside OMV
joins _ssh when it is opened, and keys go through setUser. Each call applies
the modules it made dirty (postfix, ssh) and leaves what was pending in the
web UI pending. setUser takes a plain password, netOrk only the hash, so the
hash is set with usermod -p. The lock stays napalm-linux's expiry.
Checked on a fresh OMV 8 (Debian 13) with the real driver over SSH and
sudo -S: a new account logs in with its key and uses sudo, is refused
after locking with OMV's keys emptied, logs in again after reopening; an
account made outside OMV is let in once it joined _ssh; a module left
dirty before stays dirty.
napalm-linux now renames a host through hostnamectl, /etc/hostname and
/etc/hosts (NAPALM/napalm-linux#45). OMV regenerates those files from
conf.system.network.dns on its next apply, so the inherited rename would
not last.
set_hostname() goes where OMV's web UI goes: Network.setGeneralSettings
(an FQDN sets the domain too, a bare name keeps it), then
Config.applyChanges with an explicit module list -- the modules the
rename made dirty, plus the hostname modules that already were. Changes
someone left pending in the web UI stay pending. Checked against the RPC
sources of OMV 8.6 (rpc/network.inc, rpc/config.inc).
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
of NAPALM/driver-standard; napalm-device-types and napalm-linux come from
git until napalm-linux 0.15.0 is on PyPI.
- requires-python >=3.10 (napalm-device-types needs it), SPDX license
string, setuptools>=77, LICENSE file, py.typed, links to git.netork.io.
- Dependencies: napalm-device-types>=4.22.0, napalm-linux>=0.15.0,
napalm>=4.0 (tested at 4.0.0); dev extra with pytest, pytest-cov, mypy
and ruff.
- mypy strict for the whole package, no exempt module: _omv_read is
annotated as returning list[dict[str, Any]] (types only).
- Coverage floor 15 % (measured 15.89 %); the four long getters and the
complexity of get_disks are recorded in the quality baseline.
- README (what it is, how it connects, the getters, what it does not do)
and CHANGELOG are new.
- The committed egg-info and __pycache__ files are untracked; .gitignore
from the template keeps them, .venv and build output out.
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.
The override counted "N upgraded" in an apt simulation run without a
fixed locale -- nothing matched on a German host -- and hid held-back
packages, which FULL_UPGRADE installs. netOrk names updates_available
from get_available_updates (netOrk #1111).
OpenMediaVault generates sshd_config from its own database; a drop-in
netOrk wrote would be dropped by the next apply of the SSH settings
without a word. harden_ssh_server = None makes netOrk's capability probe
answer no.
Requires napalm-linux 0.5.0; bumps to 0.1.1. NetOrk/netork#1027
A plain apt-get upgrade holds back OMV's own packages and the kernel;
omv-upgrade is a dist-upgrade. netOrk reads FULL_UPGRADE when it upgrades
the host (MVP 5).
The TYPE_LABEL attribute on the base class hierarchy is now the
canonical way for drivers to declare their device category. The
storage_device sentinel flag is removed — classification is determined
by reading TYPE_LABEL via getattr() in the backend.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>