Skip to content

Commit

Permalink
ctdb: handle nodes with "GONE" state when listing CTDB nodes
Browse files Browse the repository at this point in the history
Added support for the GONE state in _entry_to_node
to exclude nodes no longer part of the cluster.

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
  • Loading branch information
avanthakkar authored and mergify[bot] committed Dec 31, 2024
1 parent 282b0b9 commit 5cdcbee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sambacc/ctdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit 5cdcbee

Please # to comment.