summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2015-09-04 14:22:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-06 15:26:22 +0100
commit924348d54b55985d184a6f1d00af795ec4097bbb (patch)
treee511ac6c5d39ad62bfc04530acaaf783776b94bc /meta/classes
parent466eee6699bff1d94db6622565ce2044c106e60c (diff)
downloadpoky-924348d54b55985d184a6f1d00af795ec4097bbb.tar.gz
report-error: send only last 5242000 characters in error logs
* otherwise whole build report submission is rejected because it's too big (From OE-Core rev: 3544b4d4d72330eb12bb3cda25cb99ed52c8a2eb) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/report-error.bbclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
index cabd98cc32..040c29ea24 100644
--- a/meta/classes/report-error.bbclass
+++ b/meta/classes/report-error.bbclass
@@ -54,13 +54,22 @@ python errorreport_handler () {
54 if log: 54 if log:
55 try: 55 try:
56 logFile = open(log, 'r') 56 logFile = open(log, 'r')
57 taskdata['log'] = logFile.read().decode('utf-8') 57 logdata = logFile.read().decode('utf-8')
58 logFile.close() 58 logFile.close()
59 except: 59 except:
60 taskdata['log'] = "Unable to read log file" 60 logdata = "Unable to read log file"
61 61
62 else: 62 else:
63 taskdata['log'] = "No Log" 63 logdata = "No Log"
64
65 # server will refuse failures longer than param specified in project.settings.py
66 # MAX_UPLOAD_SIZE = "5242880"
67 # use lower value, because 650 chars can be spent in task, package, version
68 max_logdata_size = 5242000
69 # upload last max_logdata_size characters
70 if len(logdata) > max_logdata_size:
71 logdata = "..." + logdata[-max_logdata_size:]
72 taskdata['log'] = logdata
64 lock = bb.utils.lockfile(datafile + '.lock') 73 lock = bb.utils.lockfile(datafile + '.lock')
65 jsondata = json.loads(errorreport_getdata(e)) 74 jsondata = json.loads(errorreport_getdata(e))
66 jsondata['failures'].append(taskdata) 75 jsondata['failures'].append(taskdata)