waft.system.clients.ssh_client.command_executor module

class waft.system.clients.ssh_client.command_executor.CommandExecutor(connection: Connection)

Bases: object

A class to execute SSH commands on a remote system via a given connection.

connection

The connection object used to execute SSH commands.

Type:

Connection

execute(command: str, retry_handler: RetryHandler | None = None, in_stream=False) Result

Executes an SSH command on the remote system with optional retry configuration.

Parameters:
  • command (List[str]) – The SSH command to execute.

  • retry_handler (Optional[RetryHandler]) – An instance of RetryHandler for retrying command execution.

  • None. (Defaults to)

  • in_stream (bool, optional) – Whether to allow input stream for the command. Defaults to False.

Returns:

An object representing the response of the SSH command.

Return type:

Result

Raises:

RuntimeError – If the command execution fails after retries.