Commit 5f46db69 authored by Łukasz Nowak's avatar Łukasz Nowak

promise/plugin: Use check_output instead of hand crafting

parent b1bc3918
......@@ -22,13 +22,14 @@ class RunPromise(GenericPromise):
command = self.getConfig('command')
try:
process = subprocess.Popen(
out = subprocess.check_output(
command,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out, _ = process.communicate()
status = process.returncode
status = 0
except subprocess.CalledProcessError as e:
out = e.output
status = e.returncode
except Exception as e:
self.logger.error(
"ERROR %r during running command %r" % (e, command))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment