Skip to content

Commit

Permalink
IOS: fix get_optics when input is N/A
Browse files Browse the repository at this point in the history
Extend the current check to ouput value to the input value.
Input value could also be N/A

Fixes napalm-automation#1205
  • Loading branch information
ExaneServerTeam committed May 11, 2020
1 parent 803f764 commit 25f200f
Showing 1 changed file with 6 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

0 comments on commit 25f200f

Please sign in to comment.