[oe-commits] [openembedded-core] 06/13: resulttool/report: Handle missing metadata sections more cleanly

git at git.openembedded.org git at git.openembedded.org
Sun Mar 24 16:54:48 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch thud-next
in repository openembedded-core.

commit 93b87a9a7056fb507a585c454cef8db7194d7393
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Feb 27 16:51:56 2019 +0000

    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 at linuxfoundation.org>
---
 scripts/lib/resulttool/report.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index 2f5ea30..5ffe262 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]:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list