Skip to content

Commit

Permalink
Check if temperature sensor on Cisco device is not supported
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheRealBecks committed Jul 1, 2019
1 parent 17b7ba2 commit ded7c46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
for line in output.splitlines():
m = re_temp_value.match(line)
if m is not None:
Expand Down

0 comments on commit ded7c46

Please sign in to comment.