-
Notifications
You must be signed in to change notification settings - Fork 557
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
Check if temperature sensor on Cisco device is not supported #1013
Conversation
Some older Cisco devices like models from the 2960 platform have no temperature sensor built-in. In that case the get_environment function will throw on exception. That case will now be handeled.
See issue 1000 |
1 similar comment
Has anyone an idea why four out of six checks fail? Looks like tox isn't working properly. |
@@ -2110,7 +2110,7 @@ def get_environment(self): | |||
re_temp_value = re.compile("(.*) Temperature Value") | |||
# The 'show env temperature status' is not ubiquitous in Cisco IOS | |||
output = self._send_command(temp_cmd) | |||
if "% Invalid" not in output: | |||
if "% Invalid" and "Not Supported" not in output: |
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.
I think if "% Invalid" not in output or "Not Supported" not in output:
might be what you want.
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.
@mirceaulinic You are 'more right' than me, but still not entirely correct: It's if "% Invalid" not in output and "Not Supported" not in output:
- and
instead of or
:) I will try to update my PR, not sure how to do that...
I branched my repository, so I had to recreate this PR, see #1055. |
Some older Cisco devices like models from the 2960 platform have no temperature sensor built-in. In that case the get_environment function will throw on exception. That case will now be handeled.