From 3b2fbbc144dac473564a383c4af86bfc2f702e01 Mon Sep 17 00:00:00 2001 From: Alice Ferrazzi Date: Mon, 14 Aug 2017 16:24:06 +0900 Subject: Making the subprocess output more readable --- elivepatch_server/resources/livepatch.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/elivepatch_server/resources/livepatch.py b/elivepatch_server/resources/livepatch.py index 8ea47e2..efa180e 100644 --- a/elivepatch_server/resources/livepatch.py +++ b/elivepatch_server/resources/livepatch.py @@ -15,9 +15,6 @@ class PaTch(object): def __init__(self): pass - # kpatch-build/kpatch-build -s /usr/src/linux-4.9.16-gentoo/ - # -v /usr/src/linux-4.9.16-gentoo/vmlinux examples/test.patch - # -c ../elivepatch/elivepatch_server/config --skip-gcc-check def build_livepatch(self, uuid, vmlinux, debug=True): """ Function for building the livepatch @@ -113,9 +110,11 @@ def command(bashCommand, kernel_source_dir=None, env=None): print(bashCommand) process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE, cwd=kernel_source_dir, env=env) output, error = process.communicate() - print(output) + for output_line in output.split(b'\n'): + print(output_line.strip()) else: print(bashCommand) process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE, env=env) output, error = process.communicate() - print(output) + for output_line in output.split(b'\n'): + print(output_line.strip()) -- cgit v1.2.3-65-gdbad