diff options
author | 2017-08-14 16:24:06 +0900 | |
---|---|---|
committer | 2017-08-14 16:24:06 +0900 | |
commit | 3b2fbbc144dac473564a383c4af86bfc2f702e01 (patch) | |
tree | 65e5f97cb7002f3cf0c8e8cc623c5374501009d6 | |
parent | added PORTAGE_CONFIGROOT for set the path from there get the incremental (diff) | |
download | elivepatch-3b2fbbc144dac473564a383c4af86bfc2f702e01.tar.gz elivepatch-3b2fbbc144dac473564a383c4af86bfc2f702e01.tar.bz2 elivepatch-3b2fbbc144dac473564a383c4af86bfc2f702e01.zip |
Making the subprocess output more readable
-rw-r--r-- | elivepatch_server/resources/livepatch.py | 9 |
1 files 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()) |