Device Status view breaks if get_environment is not available on the driver #2307

Closed
opened 2025-12-29 17:24:40 +01:00 by adam · 1 comment
Owner

Originally created by @ChrisPortman on GitHub (Jan 22, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.5.3

The device status javascript breaks if the napalm driver does not support the get_environment method as is the case for nxos.

Steps to Reproduce

  1. Set up a device using a napalm driver that does not support get_environment (e.g. nxos)
  2. Browse to the Status tab of the device view.

Expected Behavior

The status page gracefully handles the missing environment data

Observed Behavior

The facts are populated, then the javascript crashes and the ajax loader remains.
The javascript console log:
TypeError: json.get_environment.memory is undefined

The ajax response is:

{
  "get_facts": {
     "os_version":"7.3(4)N1(1)",
     "model":"Nexus 5696 Chassis", 
     ...
  }
  "get_environment": {
    "error":"Method get_environment not implemented for NAPALM driver <class 'napalm.nxos.nxos.NXOSDriver'>"
  }
}
Originally created by @ChrisPortman on GitHub (Jan 22, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.5.3 The device status javascript breaks if the napalm driver does not support the get_environment method as is the case for nxos. ### Steps to Reproduce 1. Set up a device using a napalm driver that does not support get_environment (e.g. nxos) 2. Browse to the Status tab of the device view. ### Expected Behavior The status page gracefully handles the missing environment data ### Observed Behavior The facts are populated, then the javascript crashes and the ajax loader remains. The javascript console log: ```TypeError: json.get_environment.memory is undefined``` The ajax response is: ``` { "get_facts": { "os_version":"7.3(4)N1(1)", "model":"Nexus 5696 Chassis", ... } "get_environment": { "error":"Method get_environment not implemented for NAPALM driver <class 'napalm.nxos.nxos.NXOSDriver'>" } } ```
adam added the type: bugstatus: accepted labels 2025-12-29 17:24:40 +01:00
adam closed this issue 2025-12-29 17:24:41 +01:00
Author
Owner

@dudusf04 commented on GitHub (Aug 22, 2019):

i have same problem, but it's in the variable get_environment and get_facts i have version 2.6.2, pls help me

@dudusf04 commented on GitHub (Aug 22, 2019): i have same problem, but it's in the variable get_environment and get_facts i have version 2.6.2, pls help me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2307