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

Check if temperature sensor on Cisco device is not supported #1013

Closed
wants to merge 5 commits into from
Closed

Conversation

TheRealBecks
Copy link
Contributor

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.

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.
@TheRealBecks
Copy link
Contributor Author

See issue 1000

@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling ded7c46 on TheRealBecks:develop into 17b7ba2 on napalm-automation:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling ded7c46 on TheRealBecks:develop into 17b7ba2 on napalm-automation:develop.

@coveralls
Copy link

coveralls commented Jul 1, 2019

Coverage Status

Coverage remained the same at ?% when pulling c6ffab9 on TheRealBecks:develop into 74cce13 on napalm-automation:develop.

@TheRealBecks
Copy link
Contributor Author

Has anyone an idea why four out of six checks fail? Looks like tox isn't working properly.
And can anyone review/test my change? Not sure if I did correct.

@@ -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:
Copy link
Member

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.

Copy link
Contributor Author

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...

@TheRealBecks
Copy link
Contributor Author

I branched my repository, so I had to recreate this PR, see #1055.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants