Skip to content

learn("interface") fails on an iosxe device #965

@jlmcgraw

Description

@jlmcgraw

learn("interface") fails on an iosxe device with the following traceback:

Traceback (most recent call last):
  File "/network/user/genie_iosxe_show_interfaces_accounting/genie_iosxe_show_interfaces_accounting.py", line 50, in <module>
    main()
  File "/network/user/genie_iosxe_show_interfaces_accounting/genie_iosxe_show_interfaces_accounting.py", line 41, in main
    model_learned_data = device.learn("interface").to_dict()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/genie/conf/base/device.py", line 640, in genie.conf.base.device.Device.learn
  File "/network/user/genie_iosxe_show_interfaces_accounting/venv/lib64/python3.11/site-packages/genie/libs/ops/interface/iosxe/interface.py", line 465, in learn
    self.make(final_call=True)
  File "/network/user/genie_iosxe_show_interfaces_accounting/venv/lib64/python3.11/site-packages/genie/ops/base/base.py", line 111, in make
    self.maker.make(*args, **kwargs)
  File "src/genie/ops/base/maker.py", line 326, in genie.ops.base.maker.Maker.make
  File "src/genie/ops/base/maker.py", line 440, in genie.ops.base.maker.Maker._call_parser
  File "src/genie/metaparser/_metaparser.py", line 308, in genie.metaparser._metaparser.MetaParser.parse
  File "/network/user/genie_iosxe_show_interfaces_accounting/venv/lib64/python3.11/site-packages/genie/libs/parser/iosxe/show_interface.py", line 3880, in cli
    ret_dict.setdefault(intf, {}).\
                        ^^^^
UnboundLocalError: cannot access local variable 'intf' where it is not associated with a value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions