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.
This commit is contained in:
Christian Manivong
2026-10-06 18:19:57 +02:00
parent 6c9a6e7017
commit c644519af6
4 changed files with 49 additions and 1 deletions
+2
View File
@@ -39,6 +39,7 @@ from napalm_device_types import (
HostStatusMixin,
HypervisorDriver,
KernelFactsMixin,
ListeningSocketsMixin,
PortSpec,
SystemdServicesMixin,
)
@@ -84,6 +85,7 @@ class ProxmoxDriver(
ProxmoxRoutingMixin,
ProxmoxSystemMixin,
KernelFactsMixin,
ListeningSocketsMixin,
SystemdServicesMixin,
HostStatusMixin,
HypervisorDriver,
+9
View File
@@ -231,6 +231,15 @@ class ProxmoxSystemMixin:
"""The transport for ``KernelFactsMixin.get_kernel_facts``: the exec path."""
return self._exec_ssh_command(command)
# ------------------------------------------------------------------ #
# Listening sockets (ListeningSocketsMixin supplies get_listening_sockets)
# ------------------------------------------------------------------ #
def _run_listening_sockets_command(self, command: str, *, privileged: bool) -> str:
"""The transport for ``ListeningSocketsMixin.get_listening_sockets``:
the exec path, which runs as root either way."""
return str(self._exec_ssh_command(command))
# ------------------------------------------------------------------ #
# Packages (Debian APT)
# ------------------------------------------------------------------ #