-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
nhrpd: fix show ip nhrp output #16700
Conversation
nhrpd/nhrp_vty.c
Outdated
@@ -1023,9 +1023,7 @@ DEFUN(show_ip_nhrp, show_ip_nhrp_cmd, | |||
} else if (argv[3]->text[0] == 's') { | |||
nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx); | |||
} else { | |||
if (!ctx.json) | |||
vty_out(vty, "Status: ok\n\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is nonsense at all (writing this status as OK) if I understand it correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It is nonsense to always write it as OK.
why dont we just drop the third commit. i fail to see a reason to change the output unless its right |
The problem is that we are always displaying "status: OK" even if shortcut failed |
"show ip nhrp opennhrp json" counter is incorrect. > root@nhs1:/# vtysh -c 'sh ip nhrp opennhrp json' | jq . > { > "attr": { > "status": "ok", > "entriesCount": 1 <=== NOK > }, > "table": [ > { > "type": "dynamic", > "up": true, > "used": false, > "protocolAddress": "172.16.1.4", > "protocolAddressSize": 32, > "nbmaAddress": "192.168.2.4" > }, > { > "type": "dynamic", > "up": true, > "used": false, > "protocolAddress": "172.16.1.5", > "protocolAddressSize": 32, > "nbmaAddress": "192.168.2.5" > } > ] > } > Fixes: 87b9e98 ("nhrpd: add json support to show nhrp vty commands") Signed-off-by: Louis Scalbert <[email protected]>
The command outputs too much "\n". Normalize it. Signed-off-by: Louis Scalbert <[email protected]>
92938b0
to
e2db455
Compare
ci:rerun |
See individual commits