All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH] resulttool/resultutils: allow index generaiton despite corrupt json
@ 2023-07-14 17:46 Michael Halstead
  0 siblings, 0 replies; only message in thread
From: Michael Halstead @ 2023-07-14 17:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: richard.purdie, Michael Halstead

non-release indexes will continue to generate when test output is
corrupted.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
---
 scripts/lib/resulttool/resultutils.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/resulttool/resultutils.py b/scripts/lib/resulttool/resultutils.py
index 7666331ba2..c5521d81bd 100644
--- a/scripts/lib/resulttool/resultutils.py
+++ b/scripts/lib/resulttool/resultutils.py
@@ -58,7 +58,11 @@ def append_resultsdata(results, f, configmap=store_map, configvars=extra_configv
             testseries = posixpath.basename(posixpath.dirname(url.path))
         else:
             with open(f, "r") as filedata:
-                data = json.load(filedata)
+                try:
+                    data = json.load(filedata)
+                except json.decoder.JSONDecodeError:
+                    print("Cannot decode {}. Possible corruption. Skipping.".format(f))
+                    data = ""
             testseries = os.path.basename(os.path.dirname(f))
     else:
         data = f
-- 
2.41.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-14 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 17:46 [OE-core][PATCH] resulttool/resultutils: allow index generaiton despite corrupt json Michael Halstead

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.