Command execution: errors read as empty output, only RSA keys, a dead API branch #17

Open
opened 2026-10-14 08:58:51 +00:00 by christianmanivong · 0 comments
Owner

_exec_ssh_command (driver.py ~290-342):

  • It first posts to /nodes/{node}/execute, which runs a batch of API calls, not a shell; the call fails and every command pays a wasted round trip before SSH (per the PVE API docs, not run live).
  • It returns out or err, so stderr reads as output, and on any exception logs at debug and returns "". No SSH credential, an auth error or a refused command all read as "nothing there". On API-token-only nodes lldpd_not_installed is raised on every poll because command -v lldpd returns "", and get_snmp_config returns None.
  • paramiko.RSAKey.from_private_key only: ed25519 and ECDSA keys fail (and are swallowed). With an API password set, ssh_pass = self._ssh_password or self.password is non-empty and the key is never used.
  • The connect code exists twice (driver.py ~320, vm_provision_mixin.py ~146-167); AutoAddPolicy accepts any host key.

Fix: one transport that raises on failure, any key type; it becomes napalm-unix's run_command (NAPALM/napalm-device-types#35).

Prio P3: wrong facts and false warnings on token-only nodes.

`_exec_ssh_command` (`driver.py` ~290-342): - It first posts to `/nodes/{node}/execute`, which runs a batch of API calls, not a shell; the call fails and every command pays a wasted round trip before SSH (per the PVE API docs, not run live). - It returns `out or err`, so stderr reads as output, and on any exception logs at debug and returns `""`. No SSH credential, an auth error or a refused command all read as "nothing there". On API-token-only nodes `lldpd_not_installed` is raised on every poll because `command -v lldpd` returns `""`, and `get_snmp_config` returns None. - `paramiko.RSAKey.from_private_key` only: ed25519 and ECDSA keys fail (and are swallowed). With an API password set, `ssh_pass = self._ssh_password or self.password` is non-empty and the key is never used. - The connect code exists twice (`driver.py` ~320, `vm_provision_mixin.py` ~146-167); `AutoAddPolicy` accepts any host key. Fix: one transport that raises on failure, any key type; it becomes napalm-unix's `run_command` (NAPALM/napalm-device-types#35). Prio P3: wrong facts and false warnings on token-only nodes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-proxmox#17