netbox icon indicating copy to clipboard operation
netbox copied to clipboard

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

Open ChrisPortman opened this issue 7 years ago • 1 comments

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'>"
  }
}

ChrisPortman avatar Jan 22 '19 01:01 ChrisPortman

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 avatar Aug 22 '19 11:08 dudusf04