File 0001-Prepend-hostname-on-each-line-when-P-is-set.patch of Package pssh
From 4d1551db70fed7e22f95b3aae5fa68ee02a82312 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Sun, 21 Dec 2014 08:32:49 +0100
Subject: [PATCH 1/2] Prepend hostname on each line when -P is set
---
psshlib/task.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/psshlib/task.py b/psshlib/task.py
index c17cc96..7282ec7 100644
--- a/psshlib/task.py
+++ b/psshlib/task.py
@@ -197,9 +197,8 @@
self.writer.write(self.outfile, buf)
if self.print_out:
text = buf.decode(errors='replace')
- sys.stdout.write('%s: %s' % (self.host, text))
- if text[-1] != '\n':
- sys.stdout.write('\n')
+ for l in buf.split('\n'):
+ sys.stdout.write("%s: %s\n" % (self.host, l))
else:
self.close_stdout(iomap)
except (OSError, IOError):