summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Halstead <mhalstead@linuxfoundation.org>2023-07-14 10:46:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-19 19:37:35 +0100
commit1a9157684a6bff8406c9bb470cb2e16ee006bbe9 (patch)
tree3e4b87a17657643a1c085bcf797fac0375d7c477 /scripts
parentc652f094d86c4efb7ff99accba63b8169493ab18 (diff)
downloadopenembedded-core-1a9157684a6bff8406c9bb470cb2e16ee006bbe9.tar.gz
resulttool/resultutils: allow index generation despite corrupt json
non-release indexes will continue to generate when test output is corrupted. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/resulttool/resultutils.py6
1 files changed, 5 insertions, 1 deletions
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