genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

NXOS: 'show access-lists summary' wrong parsing

Open VladKh opened this issue 1 year ago • 3 comments

Hi genie team, There is a mistake in the show access-lists summary parser for NXOS in regular expression genie/libs/parser/nxos/show_acl.py line 366 p1 = re.compile(r'^(?P<type>[A-Z0-9]+) +ACL +(?P<name>\S+)$') and 389 p = re.compile(r'^(?P<ip>[A-Z0-9]+) +ACL +(?P<name>\S+)\n +Total +ACEs +Configured: +(?P<total_configured>\d+)\n +Configured +on +interfaces:\n(?: +(?P<interface>\S+) +- +(?P<traffic>egress|ingress)( +\((?P<type>[\w\s]+)\))?\n)? +(?P<active>Active) +on +interfaces:(?:\n +(?P<interface2>\S+) +- +(?P<traffic2>egress|ingress)( +\((?P<type2>[\w\s]+)\))?)?')

The parser skips output like in the example:

# show access-lists summary

IPV4 ACL ALLOW-MGT
        Total ACEs Configured: 14
        Configured on interfaces:
                VTY         - ingress
        Active on interfaces:
                VTY         - ingress
IPV4 ACL CORP-CCRPRIV-INOUT
        Total ACEs Configured: 8
        Configured on interfaces:
                Vlan2007 - ingress (Router ACL)
                Vlan2007 - egress (Router ACL)
                Vlan2102 - ingress (Router ACL)
                Vlan2102 - egress (Router ACL)
        Active on interfaces:
                Vlan2007 - ingress (Router ACL)
                Vlan2007 - egress (Router ACL)
                Vlan2102 - ingress (Router ACL)
                Vlan2102 - egress (Router ACL)
IPV4 ACL L3-UPG-MEDIUM-TRUST        Statistics enabled
        fragments permit-all
        Total ACEs Configured: 10
        Configured on interfaces:
                Vlan2471 - egress (Router ACL)
                Vlan2473 - egress (Router ACL)
        Active on interfaces:
                Vlan2471 - egress (Router ACL)
                Vlan2473 - egress (Router ACL)
IPV4 ACL L3-UPG-UPG-HIGH-TRUST        Statistics enabled
        fragments permit-all
        Total ACEs Configured: 10
        Configured on interfaces:
                Vlan2472 - egress (Router ACL)
                Vlan2474 - egress (Router ACL)
        Active on interfaces:
                Vlan2472 - egress (Router ACL)
                Vlan2474 - egress (Router ACL)

Software:

BIOS: version 05.45 NXOS: version 9.3(9) Hardware cisco Nexus9000 C9336C-FX2 Chassis

Package                      Version
---------------------------- ---------
genie                        23.2
genie.libs.clean             23.2
genie.libs.conf              23.2
genie.libs.filetransferutils 23.2
genie.libs.health            23.2
genie.libs.ops               23.2
genie.libs.parser            23.2
genie.libs.sdk               23.2
pyats                        23.2
pyats.aereport               23.2
pyats.aetest                 23.2
pyats.async                  23.2
pyats.connections            23.2
pyats.datastructures         23.2
pyats.easypy                 23.2
pyats-genie-command-parse    1.3.5
pyats.kleenex                23.2
pyats.log                    23.2
pyats.reporter               23.2
pyats.results                23.2
pyats.tcl                    23.2
pyats.topology               23.2
pyats.utils                  23.2

VladKh avatar Apr 20 '23 10:04 VladKh

Hi @VladKh ,

I Resolved this issue with your output, can you please check and confirm.

ParimiNeeraja avatar Jun 27 '23 05:06 ParimiNeeraja

Hello @ParimiNeeraja, Could you please share a link to the fix?

VladKh avatar Jun 27 '23 13:06 VladKh

it will be available on 23.7 released.

ParimiNeeraja avatar Jun 27 '23 15:06 ParimiNeeraja