diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-20 11:20:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-21 12:37:52 +0000 |
commit | 900f27a98343acae497b2a81de633f2d8f268d94 (patch) | |
tree | 978f9c5137205b57294725316895006b47bd413e /meta/classes | |
parent | 88528a128fe7c11871c24706ff6d245b183d6975 (diff) | |
download | ast2050-yocto-poky-900f27a98343acae497b2a81de633f2d8f268d94.zip ast2050-yocto-poky-900f27a98343acae497b2a81de633f2d8f268d94.tar.gz |
report-error: Handle the case no logfile exists
If the task fails early, no error log may exist. Currently we crash in
that case, this handles the situation more gracefully.
(From OE-Core rev: 1e6bfcab47f532677f87683ba2f5e5fb905e9ba5)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/report-error.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass index 5fe2355..8b30422 100644 --- a/meta/classes/report-error.bbclass +++ b/meta/classes/report-error.bbclass @@ -44,11 +44,14 @@ python errorreport_handler () { task = e.task taskdata={} log = e.data.getVar('BB_LOGFILE', True) - logFile = open(log, 'r') taskdata['package'] = e.data.expand("${PF}") taskdata['task'] = task - taskdata['log'] = logFile.read() - logFile.close() + if log: + logFile = open(log, 'r') + taskdata['log'] = logFile.read() + logFile.close() + else: + taskdata['log'] = "No Log" jsondata = json.loads(errorreport_getdata(e)) jsondata['failures'].append(taskdata) errorreport_savedata(e, jsondata, "error-report.txt") |