Skip to content

Commit 961d1c1

Browse files
anoopcs9mergify[bot]
authored andcommitted
samba_cmds: Switch ctdb to CommandArgs type
When '--samba-debug-level' (or SAMBA_DEBUG_LEVEL env var) is specified with samba-container command it adds '--debuglevel' to the underlying command which is not valid for ctdb resulting in "Invalid option". Instead change its internal type to parent class CommandArgs where we get to run without debug arguments. Signed-off-by: Anoop C S <[email protected]>
1 parent 4ba0646 commit 961d1c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sambacc/ctdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,12 +764,12 @@ def archive_tdb(iconfig: config.InstanceConfig, dest_dir: str) -> None:
764764
os.rename(tdb_path, dest_path)
765765

766766

767-
def check_nodestatus(cmd: samba_cmds.SambaCommand = samba_cmds.ctdb) -> None:
767+
def check_nodestatus(cmd: samba_cmds.CommandArgs = samba_cmds.ctdb) -> None:
768768
cmd_ctdb_check = cmd["nodestatus"]
769769
samba_cmds.execute(cmd_ctdb_check)
770770

771771

772-
def _read_command_pnn(cmd: samba_cmds.SambaCommand) -> typing.Optional[int]:
772+
def _read_command_pnn(cmd: samba_cmds.CommandArgs) -> typing.Optional[int]:
773773
"""Run a ctdb command assuming it returns a pnn value. Return the pnn as an
774774
int on success, None on command failure.
775775
"""

sambacc/samba_cmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def samba_dc_foreground() -> SambaCommand:
188188

189189
ltdbtool = CommandArgs("ltdbtool")
190190

191-
ctdb = SambaCommand("ctdb")
191+
ctdb = CommandArgs("ctdb")
192192

193193
sambatool = SambaCommand("samba-tool")
194194

0 commit comments

Comments
 (0)