salt#

salt CLI factory.

class saltfactories.cli.salt.Salt(*, config, config_dir=_Nothing.NOTHING, python_executable=None, system_service=False, cwd=_Nothing.NOTHING, environ=_Nothing.NOTHING, slow_stop=True, system_encoding=_Nothing.NOTHING, timeout=_Nothing.NOTHING, script_name, base_script_args=_Nothing.NOTHING, hard_crash=False, merge_json_output=True)[source]#

Bases: SaltCli

salt CLI factory.

Parameters:
cmdline(*args, minion_tgt=None, **kwargs)[source]#

Build the command line for the CLI in question.

process_output(stdout, stderr, cmdline=None)[source]#

Process the returned output.

get_base_script_args()#

Returns any additional arguments to pass to the CLI script.

Return type:

List[str]

get_display_name()#

Returns a human readable name for the factory.

get_minion_tgt(minion_tgt=None)#

Return the minion target ID.

get_script_args()#

Returns any additional arguments to pass to the CLI script.

get_script_path()#

Returns the path to the script to run.

Return type:

str

is_running()#

Returns true if the sub-process is alive.

Return type:

bool

property pid: int | None#

The pid of the running process. None if not running.

run(*args, env=None, _timeout=None, **kwargs)#

Run the given command synchronously.

Keyword Arguments:
args:

The list of arguments to pass to cmdline() to construct the command to run

env:

Pass a dictionary of environment key, value pairs to inject into the subprocess.

_timeout:

The timeout value for this particular run() call. If this value is not None, it will be used instead of timeout, the default timeout.

Parameters:
Return type:

ProcessResult

terminate()#

Terminate the started subprocess.

Return type:

ProcessResult