Skip to content

Commit

Permalink
Bugfix/ios get optics input na (#1206)
Browse files Browse the repository at this point in the history
* IOS: fix get_optics when input is N/A

Extend the current check to ouput value to the input value.
Input value could also be N/A

Fixes #1205

* Add test
  • Loading branch information
ExaneServerTeam authored May 11, 2020
1 parent b29c554 commit 82cda2b
Show file tree
Hide file tree
Showing 3 changed files with 709 additions and 1 deletion.
7 changes: 6 additions & 1 deletion napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,17 @@ def get_optics(self):

port_detail = {"physical_channels": {"channel": []}}

# If interface is shutdown it returns "N/A" as output power.
# If interface is shutdown it returns "N/A" as output power
# or "N/A" as input power
# Converting that to -100.0 float
try:
float(output_power)
except ValueError:
output_power = -100.0
try:
float(input_power)
except ValueError:
input_power = -100.0

# Defaulting avg, min, max values to -100.0 since device does not
# return these values
Expand Down
Loading

0 comments on commit 82cda2b

Please sign in to comment.