remote_dispatch

This module provides a standalone “server” that accepts commands on stdin and will be used to securely execute multiple commands over a single ssh connection. This script allows us to execute a command as-is without interpreting any arguments, and retrieve the exit status as well as capture and forwad stdout and stderr back to the client.

Classes

Dispatcher()

The main dispatcher.

ExecutionSettings()

Execution settings for the next command.

Functions

simple_automation.remote_dispatch.read_data()

Read arbitrary data

simple_automation.remote_dispatch.read_len()

Read a newline delimited length

simple_automation.remote_dispatch.read_mode()

Read and return a mode (newline terminated string)

simple_automation.remote_dispatch.read_str()

Read arbitrary string

simple_automation.remote_dispatch.read_str_list()

Read a string list

simple_automation.remote_dispatch.resolve_script_path()

Guard script name resolution because the remote variant will not be executed from a file.

simple_automation.remote_dispatch.write_data(data)

Write arbitrary binary data (sends a length, newline, data)

simple_automation.remote_dispatch.write_mode(mode)

Write a mode (newline terminated string)

simple_automation.remote_dispatch.write_str(s)

Write arbitrary string