]> git.proxmox.com Git - mirror_frr.git/commit
topogen: added JSON output support for vtysh_cmd
authorRafael Zalamena <rzalamena@gmail.com>
Wed, 28 Jun 2017 18:30:44 +0000 (15:30 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:11 +0000 (20:22 -0500)
commita40daddc4c7c3e0f30f2a136a9ae9165e351bcdc
tree71f4669a0abfe1a15964558b08834c7624980b06
parent09e21b44879ea05365d56feca6ce35a8c1753a63
topogen: added JSON output support for vtysh_cmd

Allow vtysh_cmd() to convert JSON output to Python data structures.
This feature will be used to get vtysh JSON outputs for tests
comparsions.

Usage example:

```py
router = get_topogen().gears['r1']
json_output = router.vtysh_cmd('show ip ospf json', isjson=True)
json_cmp(json_output, {'important_key': 'important_value'})
```
tests/topotests/lib/topogen.py