Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtysh, zebra: fix malformed json output for multiple vrfs in command 'show ip route vrf all json' (backport #15632) #15644

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 30, 2024

Similarly to issue mentioned here: #15277, the 'show ip route vrf all json' command doesn't work as expected, because it doesn't return a valid json object.
Command 'show ip route vrf <vrf_name> json' returns a valid json object, however for multiple vrfs the output looks like this:

{//vrf1 routes}{//vrf2 routes}{//vrf3 routes}

After the fix we get:

{"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}}

Which is a valid json object, that can be parsed effectively using built-in modules. That makes a big difference for anyone that wants to take the json outputs for multiple vrfs and make use of them. The rest of the commands remain unaffected and behave the same.


This is an automatic backport of pull request #15632 done by Mergify.

…'show ip route vrf all json'

Command 'show ip route vrf <vrf_name> json' returns a valid json object,
however if instead of <vrf_name> we specify 'all', we get an invalid json
object, like:

{//vrf1 routes}{//vrf2 routes}{vrf3 routes}

After the fix:

{"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}}

Which is a valid json object, that can be parsed effectively using built-in
modules. The rest of the commands remains unaffected and behave the same.

Signed-off-by: Piotr Suchy <[email protected]>
(cherry picked from commit 0e2fc3d)
@Jafaral Jafaral merged commit f651b2b into dev/10.0 Apr 1, 2024
14 checks passed
@mergify mergify bot deleted the mergify/bp/dev/10.0/pr-15632 branch April 1, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants