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
> <module>
>     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
mr10.3.1
Victor Seva 4 years ago
parent 26e61941ac
commit b00f2646da

@ -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)

Loading…
Cancel
Save