from remote.remote_util import RemoteMachineShellConnection conn = RemoteMachineShellConnection('hostname', 'username', 'password') output, error = conn.execute_command('ls /home') print(output) conn.disconnect()
from remote.remote_util import RemoteMachineShellConnection conn = RemoteMachineShellConnection('hostname', 'username', 'password') commands = ['ls /home', 'whoami', 'uptime'] results = conn.execute_multi_command(commands) for output, error in results: print(output) conn.disconnect()In this example, we create a new `RemoteMachineShellConnection` and define a list of commands to be executed on the remote machine. We use the `execute_multi_command` method to run the commands in parallel, which returns a list of tuples containing the output and error messages for each command. We then loop through the list of results and print the output to the console. Finally, we disconnect from the remote machine.