Commit Graph
108 Commits
Author SHA1 Message Date
Christian Manivong 4ee74e4b3d fix(users): list real login accounts and read admins from the ACL
The passwd filter's precedence was inverted: it listed uid < 1000
(daemon, bin, ...) and skipped regular users. The level check looked
for "Administrator" in the user record, which never names roles. The
level now comes from /access/acl (Administrator on /, by user or
group), root@pam always 15.

Closes #19
2026-11-01 21:50:16 +01:00
Christian Manivong 037a725b74 fix(updates): report a failed apply_updates as a failure
apt-get ran with "|| true" and the result was always success, so a
failed upgrade read as done. The exit status is read now and a failure
names it.

Closes #20
2026-11-01 21:48:48 +01:00
Christian Manivong 8f10bef7c5 fix(hostname): rename only the node's own names in /etc/hosts
The rename replaced \b<old>\b, which also matches before "." and "-":
"pve.old.lan pve" became "new.dom.old.lan new.dom" and "pve-backup"
became "new-backup". Whole whitespace-separated names are renamed now,
comments left alone.

The live move of /etc/pve/nodes/<old> the issue also asks about is not
changed here; it needs a decision on clustered nodes.

Refs #21
2026-11-01 21:48:06 +01:00
Christian Manivong 89c70d85be fix(lldp): keep every neighbour of a port apart
lldpcli prints one Interface block per neighbour. The summary parser
reused the port's last entry, so a second neighbour overwrote the
first, and a neighbour without SysName was dropped. Each block now
starts an entry of its own.

Closes #22
2026-11-01 21:46:51 +01:00
Christian Manivong 0779695349 fix(vm-provision): pass every SSH key, one per line
Proxmox's sshkeys holds one OpenSSH key per line, URL-encoded. The keys
were joined with ";", so only the first one worked, and quote() kept
"/" unescaped, which Proxmox's urlencoded format refuses.

Closes #23
2026-11-01 21:45:49 +01:00
Christian Manivong 52d63eb689 fix(snmp): let the snmpd.conf write report its exit status
The write ended in `exit $s`, which ends the shell inside the braces
_rc wraps around every command, so __PVE_RC was never printed and the
step always failed. The write now shares the apt file writer, which
ends in a test instead of exit.

Closes #30
2026-11-01 21:44:23 +01:00
Christian Manivong d142db73e5 fix(sdn): restore the virtual interface prefixes for set_vlan
b1ba991 removed _VIRTUAL_IFACE_PREFIXES while _is_physical_uplink still
read it. The AttributeError was swallowed by _find_switch_uplink, so
set_vlan never found an uplink on any node. Restore the constant and
cover both helpers with tests.

Closes #37
2026-11-01 21:43:09 +01:00
christianmanivong cb29a42c31 Merge pull request 'feat: get_clusters() for the whole cluster, node= refused for another node' (#39) from feat/cluster-inventory into main
driver / lint (push) Successful in 13s
driver / test (3.12) (push) Failing after 6s
driver / lowest (push) Successful in 39s
driver / types (push) Successful in 1m4s
driver / test (3.13) (push) Successful in 1m6s
driver / build (push) Successful in 26s
driver / security (push) Successful in 1m10s
driver / publish (push) Skipped
driver / standard (push) Successful in 15s
CI / driver (push) Failing after 2m8s
2026-11-01 19:06:53 +00:00
Christian Manivong 25369df572 refactor: import the cluster shapes from the package root
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m16s
driver / test (3.13) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 34s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m21s
CI / driver (pull_request) Successful in 2m58s
driver / publish (pull_request) Skipped
napalm-device-types keeps them in a module of their own now; the package exports them.

Refs NetOrk/netork#484
2026-11-01 17:08:10 +01:00
Christian Manivong f60532e434 feat: get_clusters() for the whole cluster, node= refused for another node
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Failing after 1m2s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 57s
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Failing after 2m42s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 13s
Every PVE node can read its whole cluster, so get_clusters() reports the
one it belongs to: name and quorum from /cluster/status, every member
(offline ones as offline, without capacity), CPU and memory from
/cluster/resources and each online node's cpuinfo, maintenance from the
HA manager where it can be read, storages grouped by name with the nodes
they are available on, and bridges and vnets with the nodes that carry
them. A standalone node is a cluster of one.

The bridge part of get_network_targets() moved to network_targets.py so
both use it. create_vm_from_cloud_init() takes node= and refuses any node
but its own before creating anything.

Refs NetOrk/netork#484, NetOrk/netork#1822
2026-11-01 16:38:38 +01:00
christianmanivong d8ac209fb9 Merge pull request 'feat: get_network_targets names each bridge's uplinks (NetOrk/netork#1325)' (#38) from feat/network-target-uplinks into main
driver / lint (push) Successful in 16s
driver / types (push) Failing after 6s
driver / test (3.13) (push) Successful in 1m7s
driver / test (3.12) (push) Successful in 1m12s
driver / lowest (push) Successful in 34s
driver / build (push) Successful in 47s
driver / security (push) Successful in 1m23s
driver / publish (push) Skipped
driver / standard (push) Successful in 20s
CI / driver (push) Failing after 2m56s
2026-10-30 09:20:32 +00:00
christianmanivong d5ae2e2915 Merge pull request 'fix: an unknown IPv6 neighbour age is -1.0, not 0.0' (#36) from fix/arp-unknown-age into main
driver / lint (push) Successful in 15s
driver / types (push) Successful in 1m32s
driver / test (3.12) (push) Successful in 1m36s
driver / test (3.13) (push) Successful in 1m35s
driver / lowest (push) Successful in 36s
driver / build (push) Successful in 36s
driver / security (push) Successful in 1m27s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
CI / driver (push) Successful in 3m37s
2026-10-30 09:11:46 +00:00
Christian Manivong 72c30dd4c2 feat: get_network_targets names each bridge's uplinks (NetOrk/netork#1325)
driver / standard (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m15s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m21s
CI / driver (pull_request) Successful in 3m5s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 15s
netOrk's VM dialog follows a bridge's physical NICs to the switch port
behind it, to warn when a VM without a VLAN tag would land nowhere. The
driver knows those NICs from the node's network config.

uplinks is read from bridge_ports (Linux bridge) or ovs_ports (OVS
bridge), one group per bridge port: a bond (slaves / ovs_bonds) as its
NICs together, a NIC alone. Internal ports (OVSIntPort) and VLAN
subinterfaces leave out, as they never carry the bridge's untagged
traffic to the switch. A port missing from the config or of a kind the
driver cannot place leaves the key out rather than guessing.
2026-10-30 09:28:07 +01:00
Christian Manivong cc9752499e fix: an unknown IPv6 neighbour age is -1.0, not 0.0
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 1m5s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 39s
driver / security (pull_request) Successful in 1m17s
CI / driver (pull_request) Successful in 2m50s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 13s
get_ipv6_neighbors_table reports ARP_AGE_UNKNOWN, as get_arp_table already
did, instead of 0.0 ("confirmed just now").

NetOrk/netork#1327
2026-10-30 08:37:08 +01:00
christianmanivong d577e7aae2 Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#35) from chore/python-312-floor into main
driver / lint (push) Successful in 13s
driver / types (push) Successful in 1m3s
driver / test (3.12) (push) Successful in 1m10s
driver / test (3.13) (push) Successful in 1m1s
driver / lowest (push) Successful in 33s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m14s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
CI / driver (push) Successful in 2m54s
2026-10-27 09:46:57 +00:00
Christian Manivong 739d12a3db chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 32s
driver / test (3.13) (pull_request) Successful in 1m5s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m25s
CI / driver (pull_request) Successful in 3m1s
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:59 +01:00
christianmanivong 8205829437 Merge pull request 'feat: shutdown_host and begin_stop_vm through the API' (#34) from feat/shutdown-requests into main
driver / lint (push) Successful in 15s
driver / types (push) Successful in 1m10s
driver / test (3.11) (push) Successful in 1m19s
driver / lowest (push) Successful in 36s
driver / test (3.12) (push) Successful in 1m9s
driver / test (3.13) (push) Successful in 1m4s
driver / build (push) Successful in 30s
driver / security (push) Successful in 1m10s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / test (3.10) (push) Successful in 1m18s
CI / driver (push) Successful in 3m38s
2026-10-27 07:41:23 +00:00
Christian Manivong 16f1b87392 feat: shutdown_host and begin_stop_vm through the API
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 1m2s
driver / test (3.10) (pull_request) Successful in 1m9s
driver / test (3.11) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 34s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Successful in 3m17s
driver / publish (pull_request) Skipped
shutdown_host() posts command=shutdown to the node itself; its guests
stop as on any shutdown. begin_stop_vm(name) asks a guest for its clean
shutdown and returns once Proxmox took it, without waiting for the
task: the caller reads get_vm_status until it stopped. Both raise
RuntimeError when Proxmox refuses; an unknown guest is a ValueError.

The contracts HostShutdownMixin and VmStopRequestMixin of
napalm-device-types (NAPALM/napalm-device-types#55); for netOrk's graph
workflows (NetOrk/netork#1636).
2026-10-27 00:39:17 +01:00
christianmanivong f3639d9990 Merge pull request 'chore: adopt the NAPALM driver standard' (#33) from chore/driver-standard into main
driver / lint (push) Successful in 17s
driver / types (push) Successful in 1m8s
driver / test (3.11) (push) Successful in 1m23s
driver / test (3.12) (push) Successful in 1m14s
driver / lowest (push) Successful in 42s
driver / test (3.13) (push) Successful in 1m9s
driver / build (push) Successful in 32s
driver / security (push) Successful in 1m10s
driver / publish (push) Successful in 32s
driver / standard (push) Successful in 17s
driver / test (3.10) (push) Successful in 1m26s
CI / driver (push) Successful in 4m6s
v0.8.0
2026-10-23 12:17:27 +00:00
Christian Manivong 711d5f2705 chore(release): 0.8.0
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 59s
driver / test (3.10) (pull_request) Successful in 1m13s
driver / test (3.11) (pull_request) Successful in 1m18s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 45s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m29s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 12s
2026-10-23 12:02:11 +02:00
Christian Manivong 457c1ca7ed chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Failing after 53s
driver / test (3.10) (pull_request) Failing after 44s
driver / test (3.11) (pull_request) Failing after 1m6s
driver / test (3.12) (pull_request) Failing after 47s
driver / test (3.13) (pull_request) Failing after 36s
driver / lowest (pull_request) Failing after 19s
driver / security (pull_request) Failing after 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Failing after 6m3s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone. napalm-device-types comes
  from git until 4.22.0 (AptProxyMixin) is on PyPI; the floor stays at
  4.22.0.
- requires-python >=3.10 (napalm-device-types needs it), py.typed, SPDX
  license string, a dev extra with floors (pytest-mock and responses are
  dropped: no test uses them), links to git.netork.io (README included).
  pytest no longer adds --cov by itself; CI passes it.
- mypy strict for the package; exempt for now, with 204 errors between
  them: napalm_proxmox.config_mixin, .driver, .interfaces_mixin,
  .lldp_mixin, .routing_mixin, .sdn_mixin, .system_mixin, .utils,
  .vm_contract_mixin, .vm_mixin and .vm_provision_mixin. They are recorded
  in the quality baseline with the long and complex functions and the two
  unannotated public methods.
- Coverage floor 68 % (measured 68.94 %).
2026-10-23 08:40:41 +02:00
Christian Manivong 3365207c98 fix: what bandit and the remaining lint rules found
- driver.py: the logger is defined after the imports (E402). The lazy
  paramiko client is annotated Any, as _node_ssh already is; the quoted
  paramiko.SSHClient named a module that is never imported there (F821).
- Unused locals are gone: get_facts' hostname, get_users' groups (both
  read a value nobody used), the ARP flags column is _flags; the output is
  unchanged.
- Long lines are wrapped: the apt-get and snmpd.conf commands are split
  into adjacent string literals, the power-action error message and the
  system mixin's docstring are wrapped; the text is unchanged.
- get_vm_status re-raises with raise ... from e (B904).
- The two except Exception: pass (closing the SSH session, the is_alive
  probe) now log at debug level (B110), so a swallowed failure leaves a
  trace.
- nosec for the empty "password" field of NAPALM's get_users shape and
  the ssh_password_auth flag (B105); all three are false positives.
- tests: unused loop variables.
2026-10-23 08:39:01 +02:00
Christian Manivong 3b873d91fe 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-23 08:37:27 +02:00
christianmanivong 1f6859de08 Merge pull request 'feat: apt's proxy on a Proxmox VE node (NetOrk/netork#1397)' (#31) 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 13s
2026-10-22 22:08:25 +00:00
Christian Manivong 7776bb904a feat: apt's proxy on a Proxmox VE node (NetOrk/netork#1397)
CI / test (3.10) (push) Failing after 19s
CI / test (3.11) (push) Failing after 17s
CI / test (3.12) (push) Failing after 20s
CI / test (3.10) (pull_request) Failing after 18s
CI / test (3.12) (pull_request) Failing after 19s
CI / test (3.11) (pull_request) Failing after 20s
The node is Debian: AptProxyMixin gives it get_package_proxy(),
get_package_proxy_report(), check_package_proxy() and the fix
configure_package_proxy(), as on any Debian host. Logged in as root, the
transports are the exec path; the file is written without an exit inside
_rc's braces, which would end the shell before the status (see #30).

Requires napalm-device-types 4.22.0; version 0.7.0.
2026-10-22 19:16:40 +02:00
christianmanivong 03c7cdfa02 Merge pull request 'feat: get_service_packages, which packages a node's systemd unit is (NetOrk/netork#1236)' (#29) from feat/service-packages-1236 into master
CI / test (3.10) (push) Successful in 38s
CI / test (3.11) (push) Successful in 42s
CI / test (3.12) (push) Successful in 52s
2026-10-19 17:08:12 +00:00
Christian Manivong e0d0147d75 feat: get_service_packages, which packages a node's systemd unit is (NetOrk/netork#1236)
CI / test (3.10) (pull_request) Successful in 42s
CI / test (3.12) (pull_request) Successful in 37s
CI / test (3.10) (push) Successful in 53s
CI / test (3.11) (push) Successful in 46s
CI / test (3.12) (push) Successful in 43s
CI / test (3.11) (pull_request) Successful in 33s
Mixes in napalm-device-types' ServicePackagesMixin; the transport is the
node's exec path, as for the kernel facts. Read-only. Requires
napalm-device-types 4.20.0; version 0.6.0.
2026-10-19 17:41:14 +02:00
christianmanivong d210c9abe8 Merge pull request 'fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)' (#27) from fix/ssh-host-key-tofu-1167 into master
CI / test (3.10) (push) Successful in 44s
CI / test (3.11) (push) Successful in 46s
CI / test (3.12) (push) Successful in 46s
2026-10-18 19:23:46 +00:00
Christian Manivong 6bb3035857 fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)
CI / test (3.10) (push) Successful in 54s
CI / test (3.11) (push) Successful in 40s
CI / test (3.12) (push) Successful in 51s
CI / test (3.10) (pull_request) Successful in 42s
CI / test (3.12) (pull_request) Successful in 49s
CI / test (3.11) (pull_request) Successful in 35s
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:46 +02:00
christianmanivong d134ccbb89 Merge pull request 'feat!: report the subscription as a license, not a warning (0.4.0)' (#26) from feat/facts-not-warnings into master
CI / test (3.10) (push) Successful in 44s
CI / test (3.11) (push) Successful in 39s
CI / test (3.12) (push) Successful in 37s
2026-10-17 08:34:56 +00:00
Christian Manivong 1100560f85 feat!: report the subscription as a license, not a warning (0.4.0)
CI / test (3.10) (push) Successful in 33s
CI / test (3.11) (push) Successful in 30s
CI / test (3.12) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.12) (pull_request) Successful in 34s
CI / test (3.11) (pull_request) Successful in 31s
get_device_warnings is gone; netOrk names the warnings from facts
(netOrk #1111). lldpd and the pending updates were already facts
(get_packages, get_available_updates). The subscription is now
get_licenses() from napalm-device-types 4.14's LicenseMixin: one
pve-subscription entry, the API status mapped to a LicenseStatus.

The old check compared against "NotFound" while the API answers
"notfound" (seen on all four nodes), so it never fired; the mapping is
case-insensitive.
2026-10-17 09:36:18 +02:00
christianmanivong 8cf334aaf5 Merge pull request 'feat!: fix templates with the caller's values replace run_device_action (0.3.0)' (#25) from feat/fix-templates into master
CI / test (3.10) (push) Successful in 42s
CI / test (3.11) (push) Successful in 41s
CI / test (3.12) (push) Successful in 46s
2026-10-17 06:48:18 +00:00
Christian Manivong 377e849237 docs: changelog for 0.3.0
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 30s
CI / test (3.12) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.12) (pull_request) Successful in 34s
CI / test (3.11) (pull_request) Successful in 30s
2026-10-17 08:29:05 +02:00
Christian Manivong 890e84ca6b feat!: fix templates with the caller's values replace run_device_action (0.3.0)
CI / test (3.10) (push) Successful in 33s
CI / test (3.11) (push) Successful in 32s
CI / test (3.12) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.12) (pull_request) Successful in 35s
CI / test (3.11) (pull_request) Successful in 30s
fix_snmp overwrote snmpd.conf with an application's values (community
"public", "Managed by netOrk", netork@localhost) through a fixed
/tmp/netork_snmpd.conf, and opened ufw for a /24 guessed from ss;
install_lldpd was an action of its own. Neither read an exit status.

The driver implements napalm-device-types 4.13's templates instead:
- configure_snmp_agent(settings): net-snmp installed, snmpd.conf with
  one rocommunity line per allowed source (mktemp, install as root),
  ufw opened for those sources only (pve-firewall stays the
  operator's), snmpd enabled and restarted;
- get_management_peer() from SSH_CONNECTION;
- install_package(name), as the contract says (raises when apt fails),
  so ensure_package comes from the base package.
Every step reads its exit status.

BREAKING CHANGE: run_device_action is removed. Requires
napalm-device-types 4.13.

Part of #24.
2026-10-17 08:28:50 +02:00
christianmanivong 98df0e21ca feat: get_system_identity for matching a node to its BMC (0.2.0)
CI / test (3.10) (push) Successful in 37s
CI / test (3.11) (push) Successful in 37s
CI / test (3.12) (push) Successful in 39s
Mixes in napalm-device-types 4.9's SystemIdentityMixin over the exec
path, which runs as root: the node's SMBIOS system UUID, product serial
and board serial, vendor placeholders empty. pve-dual, a Supermicro
X10DRL-i, reports the product serial 0123456789; its board serial and
UUID are what tie it to its BMC.
2026-10-13 12:20:14 +02:00
christianmanivong 363f93c895 Merge pull request 'feat(vm-provision): provision FreeBSD and OpenBSD guests' (#16) from feat/guest-os into master
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 31s
CI / test (3.12) (push) Successful in 35s
2026-10-08 06:05:05 +00:00
Christian Manivong ecff2b430d feat(vm-provision): provision FreeBSD and OpenBSD guests
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 32s
CI / test (3.12) (push) Successful in 36s
CI / test (3.10) (pull_request) Successful in 34s
CI / test (3.12) (pull_request) Successful in 35s
CI / test (3.11) (pull_request) Successful in 32s
create_vm_from_cloud_init(guest_os=...) with GUEST_AGENTS from
napalm-device-types 3.0 (QEMU_GUEST_AGENTS: Linux, FreeBSD, OpenBSD). An
unknown guest_os is refused before anything is created. Found on FreeBSD
15.1 and OpenBSD 7.9 cloud images (NetOrk/netork#793):

- OS type `other` for the BSDs. OpenBSD's qemu-ga only works over ISA
  serial, and only as the second port: the image keeps its console on
  com0, so the VM gets `serial0: socket` next to `agent: 1,type=isa`.
- A BSD guest gets a network-config v2 snippet of its own
  (`cicustom: user=...,network=...`, MAC read back from net0). FreeBSD's
  nuageinit fails on the v1 Proxmox generates and then skips runcmd,
  which starts the guest agent. Linux keeps Proxmox's own.
- Packed images (FreeBSD's .qcow2.xz) are unpacked on the node after the
  packed file's checksum is verified; only the unpacked file is cached.
  download-url unpacks ISOs only, so they always take the SSH path.

Fixed on the way:
- get_vm_status skipped loopback only when it was called `lo`; OpenBSD's
  agent lists `lo0` first, so 127.0.0.1 would have been the VM's IP.
  Loopback is now recognised by its address.
- destroy_vm read cicustom after deleting the VM, when its config was gone,
  so snippets stayed on the node; it now reads them first and removes all
  of them (#15).
2026-10-08 07:53:58 +02:00
christianmanivong 0d71b98e6a Merge pull request 'ci: run the tests and build the package on every push and pull request' (#14) from ci/workflow into master
CI / test (3.10) (push) Successful in 33s
CI / test (3.11) (push) Successful in 31s
CI / test (3.12) (push) Successful in 37s
2026-10-07 06:51:13 +00:00
Christian Manivong 0dc6fcb43a test: destroy_vm on a stopped VM no longer spins for a minute and gigabytes
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 31s
CI / test (3.12) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.12) (pull_request) Successful in 35s
CI / test (3.11) (pull_request) Successful in 32s
test_destroy_vm_already_stopped left the stop task a bare MagicMock, so
_wait_for_task never saw "stopped" and looped for the full 60 s timeout
with time.sleep patched out. Every call landed in mock_calls: the test
took 60 s and up to 6 GB, and the new CI's 3.12 job was killed for it
(exit 137).

The stop call now raises, as Proxmox does for a VM that is not running --
which is the case the test is named for. The suite drops from 63 s to 4 s.
2026-10-07 08:13:00 +02:00
Christian Manivong 80e9fc3c81 ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 1m39s
CI / test (3.11) (push) Successful in 1m37s
CI / test (3.12) (push) Failing after 1m24s
CI / test (3.10) (pull_request) Successful in 1m39s
CI / test (3.12) (pull_request) Failing after 1m24s
CI / test (3.11) (pull_request) Successful in 1m38s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.
2026-10-07 07:52:44 +02:00
christianmanivong 171ab8888f Merge pull request 'feat: read the node's listening sockets through napalm-device-types' (#11) from feat/listening-sockets into master 2026-10-06 16:20:13 +00:00
Christian Manivong c644519af6 feat: read the node's listening sockets through napalm-device-types
ProxmoxDriver mixes in ListeningSocketsMixin (napalm-device-types 2.4.0)
and carries its command over the exec path, which runs as root either
way: whether pveproxy, a Ceph manager or anything else on the node listens
on an address reachable from outside it.

For netOrk#658.
2026-10-06 18:19:57 +02:00
christianmanivong 6c9a6e7017 Merge pull request 'feat: declare that upgrading everything must be a full upgrade on Proxmox VE' (#10) from feat/full-upgrade into master 2026-10-06 10:27:21 +00:00
Christian Manivong 66c9be7d25 feat: declare that upgrading everything must be a full upgrade on Proxmox VE
A plain apt-get upgrade holds back what needs new or removed packages and
can leave a node half updated; Proxmox documents apt full-upgrade. netOrk
reads FULL_UPGRADE when it upgrades the host (MVP 5).
2026-10-06 12:27:02 +02:00
christianmanivong 222cd45c66 Merge pull request 'feat: report where an update comes from and whether it is a security fix, refresh the index, read the host status' (#9) from feat/update-origin-host-status into master 2026-10-05 22:20:09 +00:00
Christian Manivong 02a441ff09 feat: report where an update comes from and whether it is a security fix, refresh the index, read the host status
For netOrk MVP 5, on napalm-device-types 2.3.0:

- get_available_updates reads `apt list --upgradable` over the exec path
  (APT_UPGRADABLE_COMMAND), so each update carries its suite and security
  status; the APT API, which names only "Debian"/"Proxmox", is the fallback
  with security unknown. It raises when neither answers instead of returning
  [] -- it used to swallow every error.
- refresh_available_updates(): POST nodes/{n}/apt/update.
- HostStatusMixin over the exec path (reboot required, self-patching).
2026-10-06 00:20:08 +02:00
christianmanivong 1881ee7330 Merge pull request 'fix: report which services are enabled, and whether an action worked' (#8) from feat/systemd-services-mixin into master 2026-10-05 11:12:15 +00:00
Christian Manivong 6bf1736619 fix: report which services are enabled, and whether an action worked
get_services() read list-unit-files' second column, which since systemd 245
is followed by a preset column -- "enabled  enabled" never equalled
"enabled", so every service on every node was reported disabled (#6).
manage_service() ended in "|| true" and returned success whatever happened.

Both now come from napalm-device-types' SystemdServicesMixin (2.2.0): the
enabled state is UnitFileState from systemctl show, MainPID comes along in
the same round trip, and an action reports systemctl's exit status. The
driver keeps only _run_service_command(), its exec path as root. The exit
status marker keeps the output non-empty, so _exec_ssh_command's SSH fallback
on an empty API answer can no longer run an action twice.

The listing no longer includes templates, static unit files and aliases that
are not loaded (on a PVE 9 node: 280 entries -> 172).

Closes #6
2026-10-05 13:12:14 +02:00
christianmanivong ea74e84387 Merge pull request 'feat: report the node kernel's modules and build configuration' (#7) from feat/kernel-facts into master 2026-10-05 04:36:48 +00:00
Christian Manivong 52074620ef feat: report the node kernel's modules and build configuration
A Proxmox node runs its own kernel under every guest, which makes it the host
where a kernel CVE's preconditions matter most. ProxmoxDriver mixes in
KernelFactsMixin from napalm-device-types and supplies only the transport,
the existing exec path.

Requires napalm-device-types 2.1.0.
2026-10-05 06:17:30 +02:00