Skip to content

Commit

Permalink
Use ctdb admin command detected from SAMBA_SPECFICS env
Browse files Browse the repository at this point in the history
Signed-off-by: Anoop C S <anoopcs@samba.org>
  • Loading branch information
anoopcs9 authored and phlogistonjohn committed Sep 20, 2022
1 parent 7c680d9 commit 39cf99a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sambacc/ctdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,9 @@ def __enter__(self) -> CLILeaderStatus:
_logger.error(f"command {pnn_cmd!r} failed: {err!r}")
except FileNotFoundError:
_logger.error(f"ctdb command ({pnn_cmd!r}) not found")
# recmaster = <ctdb recmaster>
recmaster_cmd = samba_cmds.ctdb["recmaster"]
# recmaster = <ctdb recmaster|leader>
admin_cmd = samba_cmds.ctdb_leader_admin_cmd()
recmaster_cmd = samba_cmds.ctdb[admin_cmd]
try:
out = subprocess.check_output(list(recmaster_cmd))
recmaster = out.decode("utf8").strip()
Expand Down

0 comments on commit 39cf99a

Please # to comment.