CiscoTestAutomation / pyats

Cisco DevNet pyATS Test Framework Bug Tracker
Apache License 2.0
152 stars 32 forks source link

pyats learn bgp - Exception: KeyError: 'advertised' #185

Open Kani999 opened 2 years ago

Kani999 commented 2 years ago

Hello,

i've run into a following problem.

Traceback (most recent call last): File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops File "/home/jankrupa/pyats_one_more_time/venv/lib/python3.10/site-packages/genie/libs/ops/bgp/iosxr/bgp.py", line 546, in learn self.make() File "/home/jankrupa/pyats_one_more_time/venv/lib/python3.10/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/jankrupa/pyats_one_more_time/venv/lib/python3.10/site-packages/genie/libs/parser/iosxr/show_bgp.py", line 4322, in cli sub_dict['advertised'][prefix]['index'][index]['path'] = path KeyError: 'advertised'


- `pyats version`

pyats version check You are currently running pyATS version: 22.9 Python: 3.10.6 [64bit]

Package Version


genie 22.9
genie.libs.clean 22.9.1 genie.libs.conf 22.9
genie.libs.filetransferutils 22.9
genie.libs.health 22.9
genie.libs.ops 22.9
genie.libs.parser 22.9
genie.libs.robot 22.9
genie.libs.sdk 22.9.1 genie.telemetry 22.9
genie.trafficgen 22.9
pyats 22.9
pyats.aereport 22.9
pyats.aetest 22.9
pyats.async 22.9
pyats.connections 22.9
pyats.contrib 22.9
pyats.datastructures 22.9
pyats.easypy 22.9
pyats.kleenex 22.9
pyats.log 22.9
pyats.reporter 22.9
pyats.results 22.9
pyats.robot 22.9
pyats.tcl 22.9
pyats.topology 22.9
pyats.utils 22.9
unicon 22.9
unicon.plugins 22.9
yang.connector 22.9

- Device version:
   - iosxr
   - Cisco IOS XR Software, Version 6.6.3[Default]

- Testbed file:

devices: LAB: type: 'router' os: 'iosxr' alias: 'lab' credentials: default: username: USER password: PASS connections: cli: protocol: ssh ip: "IP"

Taarini commented 2 years ago

Hi

Can you please share the device output for the above mentioned error and also the testbed file used

Kani999 commented 2 years ago

@Taarini i've added the Testbed file to the original post. The files:

Taarini commented 2 years ago

What was the show command issued which caused you keyerror. If the file size is large you can try sending in zip file. I need to identify why it is erroring out. Without device output it is difficult to debug

Kani999 commented 2 years ago

@Taarini is it okay to share the last command from the bgp_iosxr_R199-lab_console.txt?

LAB#show bgp instance all all all neighbors 1.2.3.4 advertised-routes
Mon Oct 17 13:20:55.676 METDST

BGP instance 0: 'default'
=========================

Address Family: VPNv4 Unicast
-----------------------------

Address Family: VPNv6 Unicast
-----------------------------

Address Family: IPv6 Labeled-unicast
------------------------------------

Address Family: IPv4 Unicast
----------------------------

Address Family: IPv4 Multicast
------------------------------

Address Family: IPv6 Unicast
----------------------------

Address Family: IPv6 Multicast
------------------------------

Address Family: L2VPN VPLS
--------------------------

Address Family: L2VPN VPWS
--------------------------

Address Family: IPv4 MVPN
-------------------------

Address Family: IPv6 MVPN
-------------------------

Address Family: IPv4 Flowspec
-----------------------------

Address Family: IPv6 Flowspec
-----------------------------

Address Family: VPNv4 Flowspec
------------------------------

Address Family: VPNv6 Flowspec
------------------------------