genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

JUNOS UnboundLocalError: local variable 'physical_interface_dict' referenced before assignment

Open maximebel opened this issue 3 years ago • 1 comments

Hello

When trying show interface extensive, I get the following error message from python : UnboundLocalError: local variable 'physical_interface_dict' referenced before assignment

I think I have identified the issue. The trace is
Physical interface: ge-0/0/1, Administratively down, Physical link is Down

but the parser is (line 1042 from parser/junos/show_interface.py)

Physical interface: ge-0/0/0, Enabled, Physical link is Up

    p1 = re.compile(r'^Physical +interface: +(?P<name>\S+), +'
        r'(?P<admin_status>\S+), +Physical +link +is +(?P<oper_status>\S+)$')

In my opinion the \S+ doesn't catch the "Administratively down"

maximebel avatar May 25 '22 14:05 maximebel

Hi, thank you for finding the issue. pyats is open source and since you already found the issue you could contribute to pyats. let me know if you need any help

omehrabi avatar Jun 02 '22 14:06 omehrabi