romtools.hpc.connection#

Classes

Connection(host[, user, port, persist_seconds])

A simple SSH connection class that uses subprocess to execute SSH and SCP commands.

Result(stdout, stderr, exited)

Simple class to encapsulate the result of a command execution.

class romtools.hpc.connection.Connection(host, user=None, port=None, persist_seconds=600)[source]#

Bases: object

A simple SSH connection class that uses subprocess to execute SSH and SCP commands.

This uses connection multiplexing (ControlMaster) to reuse an existing connection per SSH session (thus only requiring authentication & handshakes once).

close()[source]#

Close the SSH connection

get(remote, local=None)[source]#

Download a file from the remote host

local(cmd)[source]#

Execute a command locally

put(local, remote=None)[source]#

Upload a file to the remote host

run(command)[source]#

Execute a command on the remote host

class romtools.hpc.connection.Result(stdout, stderr, exited)[source]#

Bases: object

Simple class to encapsulate the result of a command execution.