From 97cefa0d20194a29354c65593d4ebeb86ab97387 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 2 Mar 2019 13:11:07 +0100 Subject: ssh_test: fix newlines in command output --- kpov_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpov_util.py b/kpov_util.py index d6bdef8..2ebc725 100755 --- a/kpov_util.py +++ b/kpov_util.py @@ -29,7 +29,7 @@ def ssh_test(host, user, password, commands=()): s.sendline(command) s.prompt() if test: - results[test] = s.before[len(command+'\r\n'):] + results[test] = s.before[len(command+'\r\n'):].strip().replace('\r\n', '\n') s.logout() except pexpect.exceptions.EOF as e: results['ssh'] = 'connection to {} as {}/{} failed (EOF)'.format(host, user, password) -- cgit v1.2.1