confparser
confparser copied to clipboard
Parsing Trunk
when parsing an interface where exact one vlan is not allowed, i got a huge list of vlans which blows up the json file.
cfg
interface GigabitEthernet3 description LAN-Link-Customer LI:L switchport trunk allowed vlan 1-665,667-4094 switchport mode trunk no ip address
json
"GigabitEthernet3": {
"description": "LAN-Link-Customer <LI:L>",
"allowed_vlan": [
"1",
"2",
"3",
...
"664",
"665",
"667",
"668",
...
"4092",
"4093",
"4094"
],
"mode": "trunk",
"ipv4": false
},
is there a way to handle / structure this more intelligent ?
The YAML file defines the action "expand" for allowed VLAN lists. If you don't want this behavior, you can remove the 'action: expand' line from the YAML definition.