Twelve bug fixes, one commit each (#37 is the P2: VLAN provisioning on Proxmox hosts has been broken since June).
fix(sdn): restore _VIRTUAL_IFACE_PREFIXES (removed in b1ba991), so _find_switch_uplink finds the uplink again and set_vlan works (#37).
fix(snmp): the snmpd.conf write goes through _write_root_file and ends in [ "$s" -eq 0 ] instead of exit $s, so configure_snmp_agent no longer fails at "configure" (#30).
fix(vm-provision): every SSH key is passed, one per line, fully URL-encoded (#23).
fix(lldp): every Interface: block is its own neighbour (#22).
fix(hostname): /etc/hosts renames only whole names; comments and pve-backup stay (#21).
fix(hostname): set_hostname refuses a node that is part of a cluster (/etc/pve/corosync.conf or /etc/corosync/corosync.conf present) with CommandErrorException; a single node renames as before (#21).
fix(updates): a failed apt-get gives success: False and an error (#20).
fix(users): local accounts are root plus uid 1000–65533; a Proxmox user is level 15 when the ACL gives it Administrator on / (directly or via a group) (#19).
fix(ntp): chrony nodes are read through chronyc -c sources/sourcestats (new pure module ntp.py); ntpq stays the fallback (#18).
fix(ssh): Ed25519/ECDSA/RSA keys, key before password, no empty password sent (#17, part — the dead /execute branch and errors read as "" belong to the shared transport, device-types#35).
fix(vm-provision): destroy_vm waits for its delete task and raises when it fails (#15).
fix(ping): every reply is parsed into results, IPv6 included (#12).
fix(vm-provision): a failed cloud-image download says why (wget -nv) and removes its .tmp (#3).
Not in this PR: #28 (half-built VM after a failure) needs a choice between the driver destroying it and an exception carrying vmid/node.
Tested: fixtures only (two tests run the generated command through a real local sh). pytest 431 passed, ruff, mypy, bandit, napalm-standard check/ratchet green (baseline only shrank).
Twelve bug fixes, one commit each (#37 is the P2: VLAN provisioning on Proxmox hosts has been broken since June).
- `fix(sdn)`: restore `_VIRTUAL_IFACE_PREFIXES` (removed in b1ba991), so `_find_switch_uplink` finds the uplink again and `set_vlan` works (#37).
- `fix(snmp)`: the snmpd.conf write goes through `_write_root_file` and ends in `[ "$s" -eq 0 ]` instead of `exit $s`, so `configure_snmp_agent` no longer fails at "configure" (#30).
- `fix(vm-provision)`: every SSH key is passed, one per line, fully URL-encoded (#23).
- `fix(lldp)`: every `Interface:` block is its own neighbour (#22).
- `fix(hostname)`: `/etc/hosts` renames only whole names; comments and `pve-backup` stay (#21).
- `fix(hostname)`: `set_hostname` refuses a node that is part of a cluster (`/etc/pve/corosync.conf` or `/etc/corosync/corosync.conf` present) with `CommandErrorException`; a single node renames as before (#21).
- `fix(updates)`: a failed `apt-get` gives `success: False` and an error (#20).
- `fix(users)`: local accounts are root plus uid 1000–65533; a Proxmox user is level 15 when the ACL gives it Administrator on `/` (directly or via a group) (#19).
- `fix(ntp)`: chrony nodes are read through `chronyc -c sources/sourcestats` (new pure module `ntp.py`); ntpq stays the fallback (#18).
- `fix(ssh)`: Ed25519/ECDSA/RSA keys, key before password, no empty password sent (#17, part — the dead `/execute` branch and errors read as `""` belong to the shared transport, device-types#35).
- `fix(vm-provision)`: `destroy_vm` waits for its delete task and raises when it fails (#15).
- `fix(ping)`: every reply is parsed into `results`, IPv6 included (#12).
- `fix(vm-provision)`: a failed cloud-image download says why (`wget -nv`) and removes its `.tmp` (#3).
Not in this PR: #28 (half-built VM after a failure) needs a choice between the driver destroying it and an exception carrying vmid/node.
Tested: fixtures only (two tests run the generated command through a real local `sh`). pytest 431 passed, ruff, mypy, bandit, `napalm-standard check`/`ratchet` green (baseline only shrank).
Closes #37
Closes #30
Closes #23
Closes #22
Closes #20
Closes #19
Closes #18
Closes #15
Closes #12
Closes #3
Closes #21
Refs #17
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
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
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
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
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
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
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
The getter ran "chronyc tracking || ntpq -pn" and parsed ntpq's format.
Proxmox VE ships chrony, so ntpq never ran and nothing matched. chrony
is now read in CSV mode (sources plus sourcestats); ntpq stays the
fallback and keeps peers without a tally mark.
Closes#18
Only RSA keys were read, and a key was used only when no password was
set; with the API password always present it never was. The key is now
read as Ed25519, ECDSA or RSA and offered first, the password second.
The rest of the issue (the API exec branch, errors read as empty
output) belongs to the shared transport of NAPALM/napalm-device-types#35.
Refs #17
DELETE /nodes/{node}/qemu/{vmid} starts a task and returns its UPID;
destroy_vm ignored it and returned while the VM could still exist, and
a failed delete went unnoticed. The task is now awaited. Reading the
snippets before the delete, the issue's first point, was fixed in
ecff2b4.
Closes#15
The probe pattern expected "from" after icmp_seq, but iputils prints
"bytes from <ip>: icmp_seq=... time=... ms", so results was always
empty. Replies by name ("from host (ip)") and over IPv6 are read too.
Closes#12
wget ran with -q, so a failure carried no reason, and a failed
download left its partial .tmp in the cache, taking the same space
again on every retry. wget now runs with -nv and the .tmp is removed
on failure, keeping wget's exit status.
Closes#3
The rename moves /etc/pve/nodes/<old> while the node still runs as <old>,
which Proxmox does not support for a cluster member. set_hostname now
checks for a corosync.conf first and raises before touching anything on
a member, or when the check cannot be read; a single node renames as
before.
The check is the file, not `pvecm status`: pvecm decides membership by
/etc/pve/corosync.conf itself, and its status also fails on a member
whose corosync is down. /etc/corosync/corosync.conf covers a member
whose /etc/pve is not mounted.
Closes#21
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Twelve bug fixes, one commit each (#37 is the P2: VLAN provisioning on Proxmox hosts has been broken since June).
fix(sdn): restore_VIRTUAL_IFACE_PREFIXES(removed inb1ba991), so_find_switch_uplinkfinds the uplink again andset_vlanworks (#37).fix(snmp): the snmpd.conf write goes through_write_root_fileand ends in[ "$s" -eq 0 ]instead ofexit $s, soconfigure_snmp_agentno longer fails at "configure" (#30).fix(vm-provision): every SSH key is passed, one per line, fully URL-encoded (#23).fix(lldp): everyInterface:block is its own neighbour (#22).fix(hostname):/etc/hostsrenames only whole names; comments andpve-backupstay (#21).fix(hostname):set_hostnamerefuses a node that is part of a cluster (/etc/pve/corosync.confor/etc/corosync/corosync.confpresent) withCommandErrorException; a single node renames as before (#21).fix(updates): a failedapt-getgivessuccess: Falseand an error (#20).fix(users): local accounts are root plus uid 1000–65533; a Proxmox user is level 15 when the ACL gives it Administrator on/(directly or via a group) (#19).fix(ntp): chrony nodes are read throughchronyc -c sources/sourcestats(new pure modulentp.py); ntpq stays the fallback (#18).fix(ssh): Ed25519/ECDSA/RSA keys, key before password, no empty password sent (#17, part — the dead/executebranch and errors read as""belong to the shared transport, device-types#35).fix(vm-provision):destroy_vmwaits for its delete task and raises when it fails (#15).fix(ping): every reply is parsed intoresults, IPv6 included (#12).fix(vm-provision): a failed cloud-image download says why (wget -nv) and removes its.tmp(#3).Not in this PR: #28 (half-built VM after a failure) needs a choice between the driver destroying it and an exception carrying vmid/node.
Tested: fixtures only (two tests run the generated command through a real local
sh). pytest 431 passed, ruff, mypy, bandit,napalm-standard check/ratchetgreen (baseline only shrank).Closes #37
Closes #30
Closes #23
Closes #22
Closes #20
Closes #19
Closes #18
Closes #15
Closes #12
Closes #3
Closes #21
Refs #17
DELETE /nodes/{node}/qemu/{vmid} starts a task and returns its UPID; destroy_vm ignored it and returned while the VM could still exist, and a failed delete went unnoticed. The task is now awaited. Reading the snippets before the delete, the issue's first point, was fixed inecff2b4. Closes #15The probe pattern expected "from" after icmp_seq, but iputils prints "bytes from <ip>: icmp_seq=... time=... ms", so results was always empty. Replies by name ("from host (ip)") and over IPv6 are read too. Closes #12