caviar.network.ssh¶
SSH module.
Bases:
BaseException
-
exception
caviar.network.ssh.
SSHInvalidSessionError
(target)¶ Bases:
BaseException
-
target
¶
-
-
exception
caviar.network.ssh.
SSHCommandError
(target, cause_lines)¶ Bases:
BaseException
-
target
¶
-
cause_lines
¶
-
-
class
caviar.network.ssh.
SSHSessionFactory
(ssh_client, private_key_path)¶ Bases:
object
SSH session factory.
-
session
(user, host, attempt_count=5, attempt_timeout=1)¶
-
close
()¶
-
-
class
caviar.network.ssh.
SSHSession
(pool, target, attempt_count, attempt_timeout)¶ Bases:
object
SSH logic session.
Parameters: - pool (SSHSessionPool) – Session pool.
- target (SSHUserHost) – Session target.
- attempt_count (int) – Session availability attempt count.
- attempt_timeout (int) – Session availability attempt timeout.
-
execute
(cmd)¶ Execute the specified command.
Parameters: cmd (str) – Command to be executed.
Return type: Returns: Iterator of standard output lines.
Raises: - caviar.network.ssh.SSHUnavailableSessionError – If it is not possible to use any physical session.
- caviar.network.ssh.SSHCommandError – If there was a command error.