Skip to content

VLAN config parsing fails if VLANs are grouped together #197

@yellowcrescent

Description

@yellowcrescent

Hello! While testing pyeapi, I discovered an issue in the api.vlans module: if VLANs are grouped together in the full config output (eg. vlan 509-510), then config parsing fails. This only seems to happen if setting a name attribute for a group of VLANs.

Example configuration that causes failure (output captured directly from vlans.config)

vlan 509-510
   name customer-5b32e5S2
   mac address learning
   state active
   mac address forwarding unicast miss action flood
   mac address forwarding multicast miss action flood
   trunk group 5b32e5S2
!

When this configuration is present, attempting to call vlans.get(509) or vlans.get(510) will return None, since the regex in vlans.get() doesn't support range-based definitions.

If multiple VLANs are using their default (unique) name, then config parsing works as expected:

vlan 509
   name VLAN0509
   mac address learning
   state active
   mac address forwarding unicast miss action flood
   mac address forwarding multicast miss action flood
   trunk group 5b32e5S2
!
vlan 510
   name VLAN0510
   mac address learning
   state active
   mac address forwarding unicast miss action flood
   mac address forwarding multicast miss action flood
   trunk group 5b32e5S2
!

Switch model/version info:

Arista DCS-7060CX-32S-R
Hardware version:      12.00
Software image version: 4.23.4.2M

I can workaround the issue for now by applying a suffix to the names (eg. customer-5b32e5S2-509) to ensure they are unique, but would rather keep the VLANs grouped together so that the switch configuration is easier to view.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions