Isolate errors when a specific NAPALM driver call fails #1642

Closed
opened 2025-12-29 16:33:45 +01:00 by adam · 1 comment
Owner

Originally created by @TheGuyDanish on GitHub (Mar 23, 2018).

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.

Originally created by @TheGuyDanish on GitHub (Mar 23, 2018). ### 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](http://napalm.readthedocs.io/en/latest/support/index.html#getters-support-matrix)). 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.
adam added the type: bugstatus: accepted labels 2025-12-29 16:33:45 +01:00
adam closed this issue 2025-12-29 16:33:45 +01:00
Author
Owner

@eriktm commented on GitHub (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.

@eriktm commented on GitHub (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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1642