Commit 4e6096c9 authored by Tristan Cavelier's avatar Tristan Cavelier

logging

parent 5659d72f
...@@ -34,6 +34,8 @@ from tempfile import mktemp ...@@ -34,6 +34,8 @@ from tempfile import mktemp
from os.path import basename from os.path import basename
from base64 import b64decode from base64 import b64decode
from cloudooo.manager import log
def keyNameToOption(key_name, prefix=""): def keyNameToOption(key_name, prefix=""):
return "--" + prefix + key_name.replace("_", "-") return "--" + prefix + key_name.replace("_", "-")
...@@ -69,14 +71,18 @@ class Handler(object): ...@@ -69,14 +71,18 @@ class Handler(object):
output_path, output_path,
conversion_kw=kw, conversion_kw=kw,
) )
stdout, stderr = Popen( proc = Popen(
command, command,
stdout=PIPE, stdout=PIPE,
stderr=PIPE, stderr=PIPE,
close_fds=True, close_fds=True,
env=self.environment, env=self.environment,
cwd=self.file.directory_name, cwd=self.file.directory_name,
).communicate() )
stdout, stderr = proc.communicate()
returncode = proc.returncode
if returncode:
log("TRISTAN exit status %s\nstdout:\n%s\n\nstderr:\n%s\n\n" %(returncode, stdout, stderr))
self.file.reload(output_path) self.file.reload(output_path)
try: try:
return self.file.getContent() return self.file.getContent()
......
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