From b9edc509bdb3fb951906adf4c277e1bc83c0852c 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"]