From b00f2646da851cbdec4ca4195bb8d1da8409973e Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 10 Jan 2022 11:25:58 +0100 Subject: [PATCH] TT#76552 bin/check.py: fix error when loading JSON file > Traceback (most recent call last): > File "/usr/share/kamailio-config-tests/./bin/check.py", line 341, in > main > check = load_json(args.kam_file) > File "/usr/share/kamailio-config-tests/./bin/check.py", line 327, in > load_json > output = json.load(file) > File "/usr/lib/python3.9/json/__init__.py", line 293, in load > return loads(fp.read(), > File "/usr/lib/python3.9/json/__init__.py", line 346, in loads > return _default_decoder.decode(s) > File "/usr/lib/python3.9/json/decoder.py", line 337, in decode > obj, end = self.raw_decode(s, idx=_w(s, 0).end()) > File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode > raise JSONDecodeError("Expecting value", s, err.value) from None > json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/share/kamailio-config-tests/./bin/check.py", line 365, in > > main(args) > File "/usr/share/kamailio-config-tests/./bin/check.py", line 344, in > main > test.error("Error loading file:%s" % args[1]) Change-Id: I1e568b6ec715ae53979fc25473e66ed5ccb70907 --- bin/check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check.py b/bin/check.py index 8ab81a0d..38b3f925 100755 --- a/bin/check.py +++ b/bin/check.py @@ -341,7 +341,7 @@ def main(args): check = load_json(args.kam_file) except Exception: check = {"flow": [], "sip_in": "", "sip_out": []} - test.error("Error loading file:%s" % args[1]) + test.error(Section.FLOW, "Error loading file:%s" % args.kam_file) test.comment("check flow") check_flow(scen["flow"], check["flow"], test)