simple_automation.context.RemoteDispatcher

class simple_automation.context.RemoteDispatcher(context, command)

Bases: object

A wrapper class around a process that executes the remote dispatch script. This will usually be an ssh command calling the script on a remote host, allowing us to send commands an receive output and return code information.

Methods

exec

Executes the given command on the remote machine as the user and with the umask given by the attached context.

expect

Waits until the given string is sent by the remote side.

read_len

Reads a length parameter from the remote process.

read_str

Reads a string from the remote process.

stop_and_wait

Stops the remote dispatcher, and waits until it exists.

write_data

Sends raw data to the remote process.

write_line

Sends a line to the remote process.

write_mode

Sends a mode to the remote dispatch process.

write_str

Sends the given string to the remote process.

write_str_list

Sends the given list of strings to the remote process.

exec(command, input=None, user=None, umask=None)

Executes the given command on the remote machine as the user and with the umask given by the attached context.

expect(s)

Waits until the given string is sent by the remote side.

read_len()

Reads a length parameter from the remote process.

read_str()

Reads a string from the remote process.

stop_and_wait()

Stops the remote dispatcher, and waits until it exists.

write_data(data)

Sends raw data to the remote process.

write_line(s)

Sends a line to the remote process.

write_mode(mode)

Sends a mode to the remote dispatch process.

write_str(s)

Sends the given string to the remote process.

write_str_list(xs)

Sends the given list of strings to the remote process.