From 5fd4397f5ffa6e1de5c33561d211ec6b35d8d146 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Tue, 5 Mar 2019 20:24:51 +0100 Subject: [PATCH] Cleaner output --- main.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index e455255..bef78cc 100644 --- a/main.py +++ b/main.py @@ -19,13 +19,7 @@ def execute(c: SSHClient, cmd: str, path: str = None) -> str: if path is not None: cmd = 'cd {}; {}'.format(path, cmd) stdin, stdout, stderr = c.exec_command(cmd) - output = stdout.read().decode('utf-8').strip() - error = stderr.read().decode('utf-8') - - if len(error) is not 0: - print('ERROR: {}'.format(error)) - - return output + return stdout.read().decode('utf-8').strip() def main(): @@ -103,6 +97,7 @@ def main(): for command in commands: output = execute(ssh, command, target) + print(command) print(output) finally: