utils.ssh module

class utils.ssh.SSHClient(stream_output=False, **connect_kwargs)[source]

Bases: paramiko.client.SSHClient

paramiko.SSHClient wrapper

Allows copying/overriding and use as a context manager Constructor kwargs are handed directly to paramiko.SSHClient.connect()

appliance_has_netapp()[source]
client_address()[source]
close()[source]
connect(hostname=None, **kwargs)[source]

See paramiko.SSHClient.connect

connected[source]
get_build_date()[source]
get_build_datetime()[source]
get_file(remote_file, local_path='', **kwargs)[source]
get_transport(*args, **kwargs)[source]
is_appliance_downstream()[source]
put_file(local_file, remote_file='.', **kwargs)[source]
run_command(command, timeout=1200.0)[source]
run_rails_command(command, timeout=1200.0)[source]
run_rake_command(command, timeout=1200.0)[source]
status[source]

Parses the output of the service evmserverd status.

Returns:A dictionary containing servers and workers, both lists. Each of the lists contains dictionaries, one per line. You can refer inside the dictionary using the headers.
uptime()[source]
class utils.ssh.SSHResult

Bases: tuple

SSHResult(rc, output)

output

Alias for field number 1

rc

Alias for field number 0

class utils.ssh.SSHTail(remote_filename, **connect_kwargs)[source]

Bases: utils.ssh.SSHClient

set_initial_file_end()[source]
utils.ssh.keygen()[source]

Generate temporary ssh keypair for appliance SSH auth

Intended not only to simplify ssh access to appliances, but also to simplify SSH access from one appliance to another in multi-appliance setups