summaryrefslogtreecommitdiff
path: root/lib/lib_errors.c
diff options
context:
space:
mode:
authorDinesh G Dutt <5016467+ddutt@users.noreply.github.com>2019-08-27 01:48:53 +0000
committerDinesh G Dutt <5016467+ddutt@users.noreply.github.com>2019-08-27 14:05:39 +0000
commit5cb5f4d04de6cfd844999179687670ac20fee690 (patch)
treea52c36142e6f8252fc50f2d413a5c8e8c9661555 /lib/lib_errors.c
parentdd7c9169522725614a05c50cb3209c0787b9be30 (diff)
bgpd: Eliminate all incorrect formulations of afi/safi in JSON
In a number of places, the JSON output had invalid key names for AFI/SAFI. For example, the key name in JSON was "IPv4 Unicast" which is invalid as a JSON Key name. Many JSON tools such as those used in Ansible, jq etc. all fail to parse the output in these scenarios. The valid name is ipv4Unicast. There's already a routine afi_safi_json() defined to handle this change, but it was not consistently called. The non-JSON version was called afi_safi_print() and it merely returned the CLI version of the string, didn't print anything. This patch deals with this issue by: - Renaming afi_safi_print to get_afi_safi_str() - get_afi_safi_str takes an additional param, for_json which if true will return the JSON-valid string - Renaming afi_safi_json to get_afi_safi_json_str() - Creating a new routine get_afi_safi_vty_str() for printing to vty - Consistently using get_afi_safi_str() with the appropriate for_json value Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
Diffstat (limited to 'lib/lib_errors.c')
0 files changed, 0 insertions, 0 deletions