Skip to content

Genie show vlan brief parser fails when VLAN names contain : #988

Description

@aoforb

Summary

The Genie ShowVlanBrief parser fails to parse VLANs whose names contain a colon (:), causing those VLANs to be silently skipped in the parsed output.

Impact

VLANs using enterprise naming conventions such as ZONE:SERVICE are not returned by the parser. This leads to incomplete or incorrect VLAN state when consuming parsed data in Ansible / automation workflows.

p1 = re.compile(
    r"^(?P<vlan>[0-9]+)+\s+(?P<vlan_name>[\w\-]+)+\s+(?P<vlan_status>[a-zA-Z\/\s]+)$"
)

p2 = re.compile(
    r"^(?P<vlan>[0-9]+)+\s+(?P<vlan_name>[\w\-]+)+\s+(?P<vlan_status>[a-zA-Z\/]+)\s+(?P<vlan_port>[a-zA-Z0-9\,\/\ ]+)$"
)

[\w\-]+ explicitly excludes : so VLAN names containing colons are never matched.

Expected behaviour

VLAN names containing : should be parsed correctly
Parsed output should preserve the VLAN name exactly as shown in CLI output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions