diff --git a/sambacc/ctdb.py b/sambacc/ctdb.py index e651bf34..bdf74572 100644 --- a/sambacc/ctdb.py +++ b/sambacc/ctdb.py @@ -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. """ diff --git a/sambacc/samba_cmds.py b/sambacc/samba_cmds.py index fa5e8b8b..26d28845 100644 --- a/sambacc/samba_cmds.py +++ b/sambacc/samba_cmds.py @@ -157,7 +157,7 @@ def __repr__(self) -> str: net = SambaCommand("net") -wbinfo = SambaCommand("wbinfo") +wbinfo = CommandArgs("wbinfo") smbd = SambaCommand("/usr/sbin/smbd") @@ -188,7 +188,7 @@ def samba_dc_foreground() -> SambaCommand: ltdbtool = CommandArgs("ltdbtool") -ctdb = SambaCommand("ctdb") +ctdb = CommandArgs("ctdb") sambatool = SambaCommand("samba-tool") @@ -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