-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature/get environment #4
base: master
Are you sure you want to change the base?
Feature/get environment #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @atta for your contributions.
really appreciate it.
please see my comments.
In addition, please remove your merge commit.
you should use rebase always to avoid merge commits.
napalm_onyx/onyx_ssh.py
Outdated
show_temperature = json.loads(self.device.send_command('show temperature | json-print')) | ||
show_resources = json.loads(self.device.send_command('show resources | json-print')) | ||
|
||
if 'MGMT' in show_fan.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using key() is not efficient.
you can use:
if 'MGMT' in show_fan:
or:
for fan in show_fan.get('MGMT', dict()):
this comment for all resource types below
@wrap_test_cases | ||
def test_get_environment(self, test_case): | ||
"""Test get_facts method.""" | ||
modale_environment = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: should be: model_environment
"temperature": dict, | ||
} | ||
_environment = self.device.get_environment() | ||
assert helpers.test_model(modale_environment, _environment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you iterate over all dict items?
b62d7f3
to
6b1d6d7
Compare
- so you can make use of it in https://github.com/digitalocean/netbox
@atta , |
since the driver isn't working anymore since many months it would be nice if you could review the acceptance policy. |
added get_environment to napalm-onyx so you can make use of it in https://github.com/digitalocean/netbox