diff options
-rwxr-xr-x | tools/merge_sth.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/merge_sth.py b/tools/merge_sth.py index 9dd7a70..c4220dc 100755 --- a/tools/merge_sth.py +++ b/tools/merge_sth.py @@ -47,8 +47,13 @@ def merge_sth(args, config, localconfig): verifiedfile = mergedb + "/verified." + mergenode["name"] try: tree = json.loads(open(verifiedfile, "r").read()) - except (IOError, ValueError): + except IOError: tree = {'tree_size': 0, "sha256_root_hash": ''} + except ValueError: + logging.error("corrupt verified file %s", verifiedfile) + return -1 + logging.debug("adding tree_size %d from %s to trees", tree['tree_size'], + verifiedfile) trees.append(tree) trees.sort(key=lambda e: e['tree_size'], reverse=True) logging.debug("trees: %s", trees) |