netbox
netbox copied to clipboard
Device Status view breaks if get_environment is not available on the driver
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
- Set up a device using a napalm driver that does not support get_environment (e.g. nxos)
- 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'>"
}
}
i have same problem, but it's in the variable get_environment and get_facts i have version 2.6.2, pls help me