diff options
author | Michael Halstead <mhalstead@linuxfoundation.org> | 2023-07-14 10:46:13 -0700 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-08-15 06:18:49 -1000 |
commit | c88c4a913b89f4d2940544bd4f5a32d62f53038d (patch) | |
tree | 174c4b5cd19848bcb1532997774bb65fe886abd6 /scripts | |
parent | a64c1f4c376a3c1213673f519764e2bee14b0469 (diff) | |
download | poky-c88c4a913b89f4d2940544bd4f5a32d62f53038d.tar.gz |
resulttool/resultutils: allow index generation despite corrupt json
non-release indexes will continue to generate when test output is
corrupted.
(From OE-Core rev: ea6c9e6a91df553e88e34a990ea15f80f469893e)
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>
(cherry picked from commit 1a9157684a6bff8406c9bb470cb2e16ee006bbe9)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/resulttool/resultutils.py | 6 |
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 | |||
58 | testseries = posixpath.basename(posixpath.dirname(url.path)) | 58 | testseries = posixpath.basename(posixpath.dirname(url.path)) |
59 | else: | 59 | else: |
60 | with open(f, "r") as filedata: | 60 | with open(f, "r") as filedata: |
61 | data = json.load(filedata) | 61 | try: |
62 | data = json.load(filedata) | ||
63 | except json.decoder.JSONDecodeError: | ||
64 | print("Cannot decode {}. Possible corruption. Skipping.".format(f)) | ||
65 | data = "" | ||
62 | testseries = os.path.basename(os.path.dirname(f)) | 66 | testseries = os.path.basename(os.path.dirname(f)) |
63 | else: | 67 | else: |
64 | data = f | 68 | data = f |