Skip to content

IOS-XE: "show ip interface brief | include Vlan" currently broken #993

@aknopper

Description

@aknopper

Hello,

The parser for "show ip interface brief | include Vlan" is currently broken for IOS-XE. src/genie/libs/parser/iosxe/show_interface.py

This is because it calls super.cli():

class ShowIpInterfaceBriefPipeVlan(ShowIpInterfaceBrief):
    cli_command = "show ip interface brief | include Vlan"
    def cli(self):
        super(ShowIpInterfaceBriefPipeVlan, self).cli()

cli_command just a string in this case, but in the ShowIpInterfaceBrief.cli() function, it's expecting a list

class ShowIpInterfaceBrief(ShowIpInterfaceBriefSchema):
    cli_command = ['show ip interface brief {interface}','show ip interface brief']

    def cli(self, interface='',output=None):
        """parsing mechanism: cli

        Function cli() defines the cli type output parsing mechanism which
        typically contains 3 steps: exe
        cuting, transforming, returning
        """
        parsed_dict = {}

        if output is None:
            if interface:
                cmd = self.cli_command[0].format(interface=interface)
            else:
                cmd = self.cli_command[1]

            out = self.device.execute(cmd)
        else:
            out = output

So it's taking index 1 of the string, which is just "h"

As a workaround, I think ShowIpInterfaceBriefPipeVlan.cli() needs its own code. I was able to take the code from ShowIpInterfaceBriefPipeIp.cli() and change the dictionary keys to match schema of ShowIpInterfaceBriefSchema (interface_is_ok,status,protocol) and get parsing to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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