question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When doing bgp parsing a `'Device' object has no attribute 'execute'` error shows up

See original GitHub issue

I’m parsing some bgp commands and for every command that has a non conditional instruction:

self.device.execute(cmd)

it answers 'Device' object has no attribute 'execute'

That ends with not parsing of commands like show ip bgp neighbor {neighbor} advertised-routes or show bgp all cluster-ids

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ThomasJRyancommented, Jan 24, 2022

The problem is this line right here: https://github.com/CiscoTestAutomation/genieparser/blob/d1e71a96dfb081e0a8591707b9d4872decd5d9d3/src/genie/libs/parser/iosxe/show_bgp.py#L4819

It’s weird that this is the way it is. As far as I’m aware, this is not allowed in a parser. Despite that though, this has been in place for three years now… If I’m understanding it, lines 4819 to 4831 should be able to be safely wrapped in a try/except to mitigate this problem. Line 4820 (vrf = 'default') would have to be put before the try/except block though. That should be an effective method of fixing this properly should you be interesting in implementing it

0reactions
balmaseacommented, Jan 18, 2022

Sorry for my late answer, we have worked around the problem with a custom parser but for sure I’d love to help. We are mainly trying to get the parsed yml from the device output that we get with our own module, so we do not connect to the devices using this library.

We are calling ShowBgpAllNeighborsAdvertisedRoutes::cli with output being, i.e.: Total number of prefixes 0

Then, it ends up calling the cli method from the parent, ShowBgpNeighborsAdvertisedRoutesSuperParser::cli and it fails when executing line: out_vrf = self.device.execute('show bgp all neighbors | i BGP neighbor') because there is no device connected.

This is what I meant with the “non conditional instruction” sentence above. Hope it is clearer now and let me know if I can continue helping. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

show bgp all neighbors <neighbor> advertised routes errors out
When running this parser (show bgp all neighbors advertised-routes) ... advertised-routes' ('Device' object has no attribute 'execute')"}.
Read more >
BGP Error Messages | Junos OS - Juniper Networks
Failure to parse the BGP update packet can happen when the attribute length does not match the length of the attribute value.
Read more >
OWL File Query Execution Error in RDFLIB - Stack Overflow
When i run the code I get an error (shown below code) which I do not understand. What could be causing this? Code....
Read more >
NAPALM Network Automation Python: Working with Cisco IOS ...
Command line tool to handle configuration on devices using NAPALM. ... Getting device facts 'list' object has no attribute 'xpath' 'list' object has...
Read more >
BGP — FRR latest documentation - FRRouting User Guide
This means that the AIGP attribute is not evaluated during the best path selection process between two paths when one path does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found