From 5cdcbee7d89fc5b6af6b8b34bc33284daca536a3 Mon Sep 17 00:00:00 2001 From: Avan Thakkar Date: Thu, 19 Dec 2024 23:50:52 +0530 Subject: [PATCH] ctdb: handle nodes with "GONE" state when listing CTDB nodes Added support for the GONE state in _entry_to_node to exclude nodes no longer part of the cluster. Signed-off-by: Avan Thakkar --- sambacc/ctdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sambacc/ctdb.py b/sambacc/ctdb.py index 6512307..e651bf3 100644 --- a/sambacc/ctdb.py +++ b/sambacc/ctdb.py @@ -448,7 +448,7 @@ def _node_line(ctdb_nodes: list[str], pnn: int) -> str: def _entry_to_node(ctdb_nodes: list[str], entry: dict[str, typing.Any]) -> str: pnn: int = entry["pnn"] - if entry["state"] == NodeState.CHANGED: + if entry["state"] == NodeState.CHANGED or entry["state"] == NodeState.GONE: return "#{}".format(ctdb_nodes[pnn].strip("#")) return entry["node"]