Rewrite show vrf to use vyos.opmode
Description
Description
Details
Details
- Difficulty level
- Normal (likely a few hours)
- Version
- 1.4
- Why the issue appeared?
- Will be filled on close
- Is it a breaking change?
- Perfectly compatible
- Issue type
- Internal change (not visible to end users)
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | FEATURE REQUEST | None | T4564 Root task for rewriting [op-mode] to vyos.opmode format | ||
Resolved | FEATURE REQUEST | Viacheslav | T4562 Rewrite show vrf to new format |
Event Timeline
Comment Actions
PR https://github.com/vyos/vyos-1x/pull/1430
vyos@r14:~$ show vrf Name State MAC address Flags Interfaces ------ ------- ----------------- ------------------------ --------------- foo up be:e3:5c:f1:54:99 noarp,master,up,lower_up eth1.50,eth1.55 bar up 1e:7c:94:da:e0:35 noarp,master,up,lower_up n/a vyos@r14:~$
Comment Actions
PR https://github.com/vyos/vyos-1x/pull/1443
vyos@r14:~$ show vrf foo Name State MAC address Flags Interfaces ------ ------- ----------------- ------------------------ ------------ foo up aa:de:40:58:2e:dd noarp,master,up,lower_up eth1.2 vyos@r14:~$ vyos@r14:~$ vyos@r14:~$ vyos@r14:~$ /usr/libexec/vyos/op_mode/vrf.py show --name bar --raw [ { "ifname": "bar", "operstate": "UP", "address": "ce:c1:4f:e8:dc:9a", "flags": [ "NOARP", "MASTER", "UP", "LOWER_UP" ] } ] vyos@r14:~$
Comment Actions
If vrf not configured:
vyos@r14:~$ /usr/libexec/vyos/op_mode/vrf.py show Traceback (most recent call last): File "/usr/libexec/vyos/op_mode/vrf.py", line 89, in <module> res = vyos.opmode.run(sys.modules[__name__]) File "/usr/lib/python3/dist-packages/vyos/opmode.py", line 118, in run res = func(**args) File "/usr/libexec/vyos/op_mode/vrf.py", line 84, in show return _get_formatted_output(vrf_data) File "/usr/libexec/vyos/op_mode/vrf.py", line 68, in _get_formatted_output state = vrf.get('operstate').lower() AttributeError: 'NoneType' object has no attribute 'lower' vyos@r14:~$