aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-06-30 18:42:55 +0900
committerAlice Ferrazzi <alicef@gentoo.org>2017-06-30 18:42:55 +0900
commit190ca77b1abe8c3a851cda48d2f6004dc9b63dfe (patch)
treef545c28e89114111156f8a2793b373678a0d735c
parentupdated copyright (diff)
downloadelivepatch-190ca77b1abe8c3a851cda48d2f6004dc9b63dfe.tar.gz
elivepatch-190ca77b1abe8c3a851cda48d2f6004dc9b63dfe.tar.bz2
elivepatch-190ca77b1abe8c3a851cda48d2f6004dc9b63dfe.zip
using list of parameters instead of using split with popen
-rw-r--r--elivepatch_server/resources/livepatch.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/elivepatch_server/resources/livepatch.py b/elivepatch_server/resources/livepatch.py
index 5c512a8..baf9df4 100644
--- a/elivepatch_server/resources/livepatch.py
+++ b/elivepatch_server/resources/livepatch.py
@@ -78,16 +78,16 @@ class PaTch(object):
:return:
"""
debug=True
- bashCommand = 'sudo kpatch-build'
- bashCommand += ' -s ' + kernel_source
- bashCommand += ' -v ' + vmlinux
- bashCommand += ' -c ' + self.config_file
- bashCommand += ' ' + self.patch_file
- bashCommand += ' --skip-gcc-check'
+ bashCommand = ['sudo','kpatch-build']
+ bashCommand.extend(['-s',kernel_source])
+ bashCommand.extend(['-v',vmlinux])
+ bashCommand.extend(['-c',self.config_file])
+ bashCommand.extend([self.patch_file])
+ bashCommand.extend(['--skip-gcc-check'])
if debug:
- bashCommand += ' --skip-cleanup'
- bashCommand += ' --debug'
+ bashCommand.extend(['--skip-cleanup'])
+ bashCommand.extend(['--debug'])
print(bashCommand)
- process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
+ process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE)
output, error = process.communicate()
print(output)