summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-27 16:51:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-27 18:03:44 +0000
commitf778c191dbd5740173b3be07f4c1655d85a07bb2 (patch)
tree91561e2496c62a45a6ac3c6b2f51a76a46a6f7d7 /scripts
parent4da12c00963b02508056b87ce9b972528ce3a1be (diff)
downloadopenembedded-core-contrib-f778c191dbd5740173b3be07f4c1655d85a07bb2.tar.gz
openembedded-core-contrib-f778c191dbd5740173b3be07f4c1655d85a07bb2.tar.bz2
openembedded-core-contrib-f778c191dbd5740173b3be07f4c1655d85a07bb2.zip
resulttool/report: Handle missing metadata sections more cleanly
Currently some older results files cause the code to give tracebacks. Handle these missing sections more cleanly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/resulttool/report.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index 2f5ea308e2..5ffe262f89 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -31,9 +31,12 @@ class ResultsTextReport(object):
def handle_ptest_result(self, k, status, result):
if k == 'ptestresult.sections':
return
- _, suite, test = k.split(".", 2)
+ try:
+ _, suite, test = k.split(".", 2)
+ except ValueError:
+ return
# Handle 'glib-2.0'
- if suite not in result['ptestresult.sections']:
+ if 'ptestresult.sections' in result and suite not in result['ptestresult.sections']:
try:
_, suite, suite1, test = k.split(".", 3)
if suite + "." + suite1 in result['ptestresult.sections']:
@@ -45,7 +48,7 @@ class ResultsTextReport(object):
for tk in self.result_types:
if status in self.result_types[tk]:
self.ptests[suite][tk] += 1
- if suite in result['ptestresult.sections']:
+ if 'ptestresult.sections' in result and suite in result['ptestresult.sections']:
if 'duration' in result['ptestresult.sections'][suite]:
self.ptests[suite]['duration'] = result['ptestresult.sections'][suite]['duration']
if 'timeout' in result['ptestresult.sections'][suite]: