feat: read the service clusters a host belongs to (0.10.0)
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 26s
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 25s

LinuxDriver mixes in napalm-device-types' ServiceClustersMixin (4.17.0):
get_service_clusters() reads Patroni's members and roles, adguardhome-sync's
origin and replicas and a BunkerWeb worker's manager from the host's own
configuration -- the evidence that two hosts run one service, not merely
answer at one address (NetOrk/netork#1125). _run_service_clusters_command
carries the shared command on an exec channel, root first, like the virtual
IPs' one.
This commit is contained in:
Christian Manivong committed 2026-10-18 15:29:02 +02:00
1 parent c8e2b328d7
commit 427a9ac8af
3 files changed
+49 -2

No files matched your search

+9
View File
@@ -46,6 +46,7 @@ from napalm_device_types import (
OpenSshServerMixin,
OSDriver,
PackageProxyMixin,
ServiceClustersMixin,
SnmpAgentMixin,
SystemIdentityMixin,
SystemdServicesMixin,
@@ -294,6 +295,7 @@ class LinuxDriver(
KernelFactsMixin,
ListeningSocketsMixin,
VirtualIpsMixin,
ServiceClustersMixin,
SystemIdentityMixin,
OpenSshServerMixin,
SystemdServicesMixin,
@@ -1179,6 +1181,13 @@ class LinuxDriver(
"""
return self.run_command(command, privileged=privileged, timeout=60).stdout
def _run_service_clusters_command(self, command: str, *, privileged: bool) -> str:
"""The transport for ``ServiceClustersMixin.get_service_clusters``: an exec
channel, like the virtual IPs' command, which it resembles in size.
Read-only either way; root only because Patroni's configuration is the
postgres user's alone."""
return self.run_command(command, privileged=privileged, timeout=60).stdout
def _run_system_identity_command(self, command: str, *, privileged: bool) -> str:
"""The transport for ``SystemIdentityMixin.get_system_identity``: an exec channel,
as root, since ``product_uuid`` and ``product_serial`` are root's."""