From 0dda43bbbc339213671b374d52c68a9653dc5b5c Mon Sep 17 00:00:00 2001 From: Alex Knop Date: Fri, 5 Jun 2026 14:21:04 -0400 Subject: [PATCH 1/2] fix parser for vlan --- src/genie/libs/parser/iosxe/show_interface.py | 53 +++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/src/genie/libs/parser/iosxe/show_interface.py b/src/genie/libs/parser/iosxe/show_interface.py index 98f1826ce..849ee3d3c 100755 --- a/src/genie/libs/parser/iosxe/show_interface.py +++ b/src/genie/libs/parser/iosxe/show_interface.py @@ -1775,7 +1775,7 @@ def yang_cli(self): return merged_output -class ShowIpInterfaceBriefPipeVlan(ShowIpInterfaceBrief): +class ShowIpInterfaceBriefPipeVlan(ShowIpInterfaceBriefSchema): """Parser for: show ip interface brief | include Vlan parser class implements detail parsing mechanisms for cli and yang output. @@ -1794,8 +1794,55 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.cmd = self.cli_command - def cli(self): - super(ShowIpInterfaceBriefPipeVlan, self).cli() + def cli(self, output=None): + + """parsing mechanism: cli + + Function cli() defines the cli type output parsing mechanism which + typically contains 3 steps: exe + cuting, transforming, returning + """ + + if output is None: + cmd = self.cli_command + out = self.device.execute(cmd) + else: + out = output + + if out: + interface_dict = {} + + # GigabitEthernet0/0 10.1.18.80 YES manual up up + p = re.compile(r'^\s*(?P[a-zA-Z0-9\/\.\-]+) ' + r'+(?P[a-z0-9\.]+) +(?P[A-Z]+) ' + r'+(?P[a-zA-Z]+) +(?P[a-z\s]+) ' + r'+(?P[a-z]+)$') + + for line in out.splitlines(): + line = line.strip() + + m = p.match(line) + if m: + interface = m.groupdict()['interface'] + if 'interface' not in interface_dict: + interface_dict['interface'] = {} + if interface not in interface_dict['interface']: + interface_dict['interface'][interface] = {} + + interface_dict['interface'][interface]['ip_address'] = \ + m.groupdict()['ip_address'] + interface_dict['interface'][interface]['interface_is_ok'] = \ + m.groupdict()['interface_is_ok'] + interface_dict['interface'][interface]['method'] = \ + m.groupdict()['method'] + interface_dict['interface'][interface]['status'] = \ + m.groupdict()['status'].strip() + interface_dict['interface'][interface]['protocol'] = \ + m.groupdict()['protocol'] + + continue + + return interface_dict def yang(self): """parsing mechanism: yang From 34bd697e1ca99a428e5887e6b4a5bd32ff915b4f Mon Sep 17 00:00:00 2001 From: Alex Knop Date: Fri, 5 Jun 2026 14:26:41 -0400 Subject: [PATCH 2/2] changelog --- ...sxe_show_ip_interface_brief_pipe_vlan_20260605142510.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/undistributed/changelog_fix_iosxe_show_ip_interface_brief_pipe_vlan_20260605142510.rst diff --git a/changelog/undistributed/changelog_fix_iosxe_show_ip_interface_brief_pipe_vlan_20260605142510.rst b/changelog/undistributed/changelog_fix_iosxe_show_ip_interface_brief_pipe_vlan_20260605142510.rst new file mode 100644 index 000000000..88da83360 --- /dev/null +++ b/changelog/undistributed/changelog_fix_iosxe_show_ip_interface_brief_pipe_vlan_20260605142510.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* + * : + * Using custom parser for cli instead of referencing ShowIpInterfaceBrief.cli() \ No newline at end of file