summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-06-13 15:49:42 +0200
committerSimo Fält <simo.falt@nokia.com>2012-06-29 12:32:16 +0200
commit013916866d57a58bd6b1782a24a38fa0f7ea8722 (patch)
tree92325a581a3573abde8d3d291bcef5e277648d81
parent15d19e3fa5b398e13ef970ab302de1410b07b8db (diff)
bldinstallercommon.py: Print output for all failing commands.
Strip leading lines of verly long logs. Change-Id: I0cbb1839906698c49f7e0ef858ad7ded37546b8e Reviewed-by: Simo Fält <simo.falt@nokia.com>
-rw-r--r--release-tools/bldinstallercommon.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/release-tools/bldinstallercommon.py b/release-tools/bldinstallercommon.py
index f63b266..95eceb9 100644
--- a/release-tools/bldinstallercommon.py
+++ b/release-tools/bldinstallercommon.py
@@ -55,6 +55,8 @@ IS_SOLARIS_PLATFORM = False
IS_MAC_PLATFORM = False
IS_WIN_PLATFORM = False
DEBUG_RPATH = False
+MAX_DEBUG_PRINT_LENGTH = 10000
+
###############################
# function
@@ -520,8 +522,10 @@ def do_execute_sub_process(args, execution_path, abort_on_fail):
theproc = subprocess.Popen(args, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=False)
else:
theproc = subprocess.Popen(args)
- theproc.communicate()
+ output = theproc.communicate()[0]
if theproc.returncode:
+ output = output[len(output) - MAX_DEBUG_PRINT_LENGTH:] if len(output) > MAX_DEBUG_PRINT_LENGTH else output
+ print output
print '*** Execution failed with code: %s' % str(theproc.returncode)
if abort_on_fail:
sys.exit(-1)
@@ -547,8 +551,10 @@ def do_execute_sub_process_2(args, execution_path, abort_on_fail):
try:
os.chdir(execution_path)
theproc = subprocess.Popen(args, shell=True)
- theproc.communicate()
+ output = theproc.communicate()[0]
if theproc.returncode:
+ output = output[len(output) - MAX_DEBUG_PRINT_LENGTH:] if len(output) > MAX_DEBUG_PRINT_LENGTH else output
+ print output
print '*** Execution failed with code: %s' % str(theproc.returncode)
if abort_on_fail:
sys.exit(-1)
@@ -580,9 +586,9 @@ def do_execute_sub_process_get_std_out(args, execution_path, abort_on_fail, prin
theproc = subprocess.Popen(args, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=False)
else:
theproc = subprocess.Popen(args, shell=False, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
- output = theproc.stdout.read()
- theproc.communicate()
+ output = theproc.communicate()[0]
if theproc.returncode:
+ output = output[len(output) - MAX_DEBUG_PRINT_LENGTH:] if len(output) > MAX_DEBUG_PRINT_LENGTH else output
print output
print '*** Execution failed with code: %s' % str(theproc.returncode)
if abort_on_fail: