forked from FRRouting/frr
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bgpd: fix show rpki json void output
"show rpki XX json" should not return a void output because json.loads() considers it to be an incorrect JSON. > >>> json.loads("") > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > 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) > >>> json.loads("{}") > {} Return "{}" instead in such a case. Link: FRRouting#15034 Fixes: dff41cc ("bgpd: Add JSON output for `show rpki prefix` and other show commands") Signed-off-by: Louis Scalbert <[email protected]>
- Loading branch information
1 parent
bbda45a
commit f53e5d5
Showing
1 changed file
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters