Skip to content

Commit

Permalink
[sfputil] Display 'N/A' for non-SFP ports (#1078)
Browse files Browse the repository at this point in the history
Currently, "Not Present" will be shown at non-sfp ports. This enhancement will show "N/A" instead of "Not Present" at non-sfp ports.
  • Loading branch information
PJHsieh authored Nov 2, 2020
1 parent 8af9aee commit ef5f212
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,11 @@ def presence(port):
click.echo("This functionality is currently not implemented for this platform")
sys.exit(5)

if presence:
output_table.append([port_name, "Present"])
if platform_sfputil._is_valid_port(physical_port):
status_string = "Present" if presence else "Not present"
output_table.append([port_name, status_string])
else:
output_table.append([port_name, "Not present"])
output_table.append([port_name, "N/A"])

i += 1

Expand Down

0 comments on commit ef5f212

Please sign in to comment.