issue with 'show vlan id {vlan_id}'
issue with 'show vlan id {vlan_id}' issue with parsing vlan_name containing '-' or '_'
Suggesting changing the regex for vlan_name to include dash, underscores and whitespaces (which are possible by using quotes).
This regex worked for me:
(?P<vlan_id>\d+)\s+(?P<vlan_name>\S+|\S+.*\S+)\s+(?P<status>active|suspended|act/lshut|sus/lshut)\s+(?P<ports>\S+|)$
It allows vlan-names containing anything, have the 4 possible statuses of a vlan and port or empty if no port.
https://github.com/CiscoTestAutomation/genieparser/blob/09f8735554c078dc4d37479f1d9a68c8cd2bc68e/src/genie/libs/parser/iosxe/show_vlan.py#L608-L611
Example raw_text
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
9 M-access-switch active Gi1/0/48
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
9 enet 100009 1500 - - - - - 0 0
Remote SPAN VLAN
----------------
Disabled
Hi viktklass,
Thank you for bringing this to our attention. Since you have already found a solution you're welcome to open a PR with your fix, but we can also add it in ourselves if you prefer.
I'm still new to Github, but will read upon the process and do a PR next week.
https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/writeparser/writeparser.html#regex-parser If you haven't read it already you might find this document helpful. Otherwise we look forward to your PR!
@viktklass please link the PR to this issue once created