Skip to content

Commit ef5f212

Browse files
authored
[sfputil] Display 'N/A' for non-SFP ports (#1078)
Currently, "Not Present" will be shown at non-sfp ports. This enhancement will show "N/A" instead of "Not Present" at non-sfp ports.
1 parent 8af9aee commit ef5f212

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sfputil/main.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,11 @@ def presence(port):
412412
click.echo("This functionality is currently not implemented for this platform")
413413
sys.exit(5)
414414

415-
if presence:
416-
output_table.append([port_name, "Present"])
415+
if platform_sfputil._is_valid_port(physical_port):
416+
status_string = "Present" if presence else "Not present"
417+
output_table.append([port_name, status_string])
417418
else:
418-
output_table.append([port_name, "Not present"])
419+
output_table.append([port_name, "N/A"])
419420

420421
i += 1
421422

0 commit comments

Comments
 (0)