confparser icon indicating copy to clipboard operation
confparser copied to clipboard

Parsing Trunk

Open stoege opened this issue 1 year ago • 1 comments

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 ?

stoege avatar Apr 06 '23 20:04 stoege

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.

tdorssers avatar Apr 16 '23 13:04 tdorssers