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

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

Closed
ChrisPortman opened this issue Jan 22, 2019 · 1 comment · Fixed by #2803
Closed

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

ChrisPortman opened this issue Jan 22, 2019 · 1 comment · Fixed by #2803
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ChrisPortman
Copy link
Contributor

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 added a commit to ChrisPortman/netbox that referenced this issue Jan 22, 2019
Check for an error in the output of each method.  If there is an error, skip processing for that method
jeremystretch pushed a commit that referenced this issue Jan 29, 2019
@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Jan 29, 2019
jeremystretch added a commit that referenced this issue Jan 29, 2019
@dudusf04
Copy link

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

@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 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

Successfully merging a pull request may close this issue.

3 participants