Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sambacc/ctdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,12 @@ def archive_tdb(iconfig: config.InstanceConfig, dest_dir: str) -> None:
os.rename(tdb_path, dest_path)


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


def _read_command_pnn(cmd: samba_cmds.SambaCommand) -> typing.Optional[int]:
def _read_command_pnn(cmd: samba_cmds.CommandArgs) -> typing.Optional[int]:
"""Run a ctdb command assuming it returns a pnn value. Return the pnn as an
int on success, None on command failure.
"""
Expand Down
6 changes: 3 additions & 3 deletions sambacc/samba_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __repr__(self) -> str:

net = SambaCommand("net")

wbinfo = SambaCommand("wbinfo")
wbinfo = CommandArgs("wbinfo")

smbd = SambaCommand("/usr/sbin/smbd")

Expand Down Expand Up @@ -188,7 +188,7 @@ def samba_dc_foreground() -> SambaCommand:

ltdbtool = CommandArgs("ltdbtool")

ctdb = SambaCommand("ctdb")
ctdb = CommandArgs("ctdb")

sambatool = SambaCommand("samba-tool")

Expand All @@ -209,6 +209,6 @@ def encode(value: typing.Union[str, bytes, None]) -> bytes:
return value


def execute(cmd: SambaCommand) -> None:
def execute(cmd: CommandArgs) -> None:
"""Exec into the command specified (without forking)."""
os.execvp(cmd.name, cmd.argv()) # pragma: no cover
Loading