Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate errors when a specific NAPALM driver call fails #1992

Closed
TheGuyDanish opened this issue Mar 23, 2018 · 1 comment
Closed

Isolate errors when a specific NAPALM driver call fails #1992

TheGuyDanish opened this issue Mar 23, 2018 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@TheGuyDanish
Copy link

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.3
  • NetBox version: 2.3.2

Description

Adding a device using the NXOS driver in NAPALM and attempting to access the 'Status' tab for that device results in Netbox throwing an error, saying there was an error connecting to the device.

I assume this is because of a lack of support for the get_environment() function in the NXOS driver for NAPALM (as noted here). Perhaps it could be an idea to not request get_environment() on drivers where the getter is not supported and instead show a warning in the Netbox interface in place of the Environment table?

Use Case

The use case for this seems quite evident. Though NAPALM can't gather the environment data about the device, it would still be useful to get facts, such as the serial, uptime, version, etc. and have that displayed.

Database schema

Sadly I can't contribute much in regard of the database, though I may imagine it would be beneficial to hold the list of NAPALM drivers and their capabilities in the database that the interface could then vary its layout from? This could possibly also tie into allowing users to select a driver for a platform, rather than typing the name of them.

@eriktm
Copy link
Contributor

eriktm commented May 24, 2018

I did some testing on this (python 3.4.8, netbox 2.3.3), and it appears that the function at dcim-api:device-napalm returns an error if one of the methods called to it fails. The response dict contains the data from get_facts as it is run first, but the error stops any data form being returned.

Specifically, a NotImplementedError is raised when calling getattr on the get_environment method.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Jul 18, 2018
@jeremystretch jeremystretch changed the title Show warning on NAPALM-related NXOS Status Isolate errors when a specific NAPALM driver call fails Jul 18, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants