Giter Site home page Giter Site logo

Learn acl model parser exception on Cisco NXOS in genie/libs/parser/nxos/show_acl.py: UnboundLocalError 'acl_dict' about genielibs HOT 10 CLOSED

Sulray avatar Sulray commented on August 28, 2024
Learn acl model parser exception on Cisco NXOS in genie/libs/parser/nxos/show_acl.py: UnboundLocalError 'acl_dict'

from genielibs.

Comments (10)

Harishv01 avatar Harishv01 commented on August 28, 2024 1

Hi Sulray,

I have raised a pull request for this. Once it is merged, I will let you know.

Thank you!!

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024 1

Hi,

I have merged the pull request, and you will see the fix in the next version, i.e., 24.3. Therefore, I am closing this ticket

Thank you!

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

Hello Sulray,

Currently, I am working on it, kindly give me some time to debug it.

Thank you.

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

Hi,

Can you share the raw output?

from genielibs.

Sulray avatar Sulray commented on August 28, 2024

Hi Harishv,

Do you mean the raw output of the learn command directly or the output of the command which led to an error in the learn ?

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

Hi Sulray,
Please provide both the output of the command that resulted in an error and the command as well.

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

Hi Sulray,
Please provide both the output of the command that resulted in an error and the command as well.

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

Hi Sulray,
Please provide both the output of the command that resulted in an error and the command as well.

from genielibs.

Sulray avatar Sulray commented on August 28, 2024

Hi, sorry for the delay

The command was :

genie learn acl --testbed-file ./testbed.yaml --devices a1aaabb1 -v

The output in the terminal at the end was :

+==============================================================================+
| Genie Learn Summary for device a1aaabb1                                      |
+==============================================================================+
|  Connected to a1aaabb1                                                       |
|  -   Log: ./connection_a1aaabb1.txt                                          |
|------------------------------------------------------------------------------|
|  Could not learn feature 'acl'                                               |
|  -  Exception:      ./acl_nxos_a1aaabb1_exception.txt                        |
|  -  Ops structure:  ./acl_nxos_a1aaabb1_ops.txt                              |
|  -  Device Console: ./acl_nxos_a1aaabb1_console.txt                          |
|==============================================================================|

In ./acl_nxos_a1aaabb1_exception.txt:

Issue while building the feature

Traceback (most recent call last):
  File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops
  File "/home/user/project/.venv/lib/python3.8/site-packages/genie/libs/ops/acl/nxos/acl.py", line 239, in learn
    self.make(final_call=True)
  File "/home/user/project/.venv/lib/python3.8/site-packages/genie/ops/base/base.py", line 103, in make
    self.maker.make(*args, **kwargs)
  File "src/genie/ops/base/maker.py", line 315, in genie.ops.base.maker.Maker.make
  File "src/genie/ops/base/maker.py", line 427, in genie.ops.base.maker.Maker._call_parser
  File "src/genie/metaparser/_metaparser.py", line 308, in genie.metaparser._metaparser.MetaParser.parse
  File "/home/user/project/.venv/lib/python3.8/site-packages/genie/libs/parser/nxos/show_acl.py", line 426, in cli
    acl_dict.update({'total_aces_configured': int(group['total_aces_configured'])}),
UnboundLocalError: local variable 'acl_dict' referenced before assignment

In ./acl_nxos_a1aaabb1_ops.txt:

{
  "_exclude": [],
  "attributes": null,
  "commands": null,
  "connections": null,
  "context_manager": {},
  "raw_data": false
}

In ./fdb_nxos_a1aaabb1_console.txt (replaced IPs with x.x.x.x/x but they are all correct IPs):

+++ a1aaabb1 with via 'cli': executing command 'show access-lists' +++
show access-lists

IP access list 199
        10 remark COMMENT01
        20 permit ip x.x.x.x/x any 
        30 remark COMMENT02
        40 permit ip x.x.x.x/x any 
        50 remark COMMENT03
        60 permit ip x.x.x.x/x any 
        70 remark COMMENT04
        80 permit ip x.x.x.x/x any 
        90 remark COMMENT05
        100 permit ip x.x.x.x/x any 
IP access list 98
        10 remark COMMENT06
        20 permit ip x.x.x.x/x any 
        30 permit ip x.x.x.x/x any 
        40 permit ip x.x.x.x/x any 
        50 permit ip x.x.x.x/x any 
        60 permit ip x.x.x.x/x any 
        70 permit ip x.x.x.x/x any 
        71 permit ip x.x.x.x/x any 
        80 remark COMMENT01
        90 permit ip x.x.x.x/x any 
        100 permit ip x.x.x.x/x any 
IP access list 99
        10 remark COMMENT07
        20 permit ip x.x.x.x/x any 
        30 permit ip x.x.x.x/x any 
IP access list COMMENT08
        10 permit ip any x.x.x.x/x

a1aaabb1# 
+++ a1aaabb1 with via 'cli': executing command 'show access-lists summary' +++
show access-lists summary


IP access list 199
        Total ACEs Configured: 5
        Configured on interfaces:
                VTY         - ingress
        Active on interfaces:
                VTY         - ingress
IP access list 98
        Total ACEs Configured: 9
        Configured on interfaces:
        Active on interfaces:
IP access list 99
        Total ACEs Configured: 2
        Configured on interfaces:
        Active on interfaces:
IP access list COMMENT09
        Total ACEs Configured: 1
        Configured on interfaces:
                Ethernetxx/x.xxx - egress (Router ACL)
        Active on interfaces:
                Ethernetxx/x.xxx - egress (Router ACL)
IP access list COMMENT10
        Total ACEs Configured: 1
        Configured on interfaces:
        Active on interfaces:
IPv6 access list COMMENT11
        Total ACEs Configured: 1
        Configured on interfaces:
        Active on interfaces:

a1aaabb1# 

from genielibs.

Harishv01 avatar Harishv01 commented on August 28, 2024

okay,I will check and get back asap

from genielibs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.