Skip to content

Commit edc5116

Browse files
committed
Fix present state for RJ45: Link Up/Down => Port Up/Down
Signed-off-by: Stephen Sun <[email protected]>
1 parent a3f6ee7 commit edc5116

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

scripts/sfpshow

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,13 @@ class SFPShow(object):
434434
sfp_info_dict = state_db.get_all(self.db.STATE_DB, 'TRANSCEIVER_INFO|{}'.format(interface_name))
435435
if sfp_info_dict:
436436
if sfp_info_dict['type'] == RJ45_PORT_TYPE:
437-
output = 'Link Up'
437+
output = 'Port Up'
438438
else:
439439
output = 'Present'
440440
else:
441441
# We have to check whether it is an RJ45 port via calling platform API in case it is absent
442442
if is_rj45_port(interface_name):
443-
output = 'Link Down'
443+
output = 'Port Down'
444444
else:
445445
output = 'Not present'
446446
return output

sfputil/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ def presence(port):
738738
sys.exit(ERROR_NOT_IMPLEMENTED)
739739

740740
if is_rj45_port_from_api(logical_port_name):
741-
status_string = "Link Up" if presence else "Link Down"
741+
status_string = "Port Up" if presence else "Port Down"
742742
else:
743743
status_string = "Present" if presence else "Not present"
744744
output_table.append([port_name, status_string])

tests/sfp_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,31 +351,31 @@ def test_sfp_presence(self):
351351
result = runner.invoke(show.cli.commands["interfaces"].commands["transceiver"].commands["presence"], ["Ethernet16"])
352352
expected = """Port Presence
353353
---------- ----------
354-
Ethernet16 Link Up
354+
Ethernet16 Port Up
355355
"""
356356
assert result.exit_code == 0
357357
assert result.output == expected
358358

359359
result = runner.invoke(show.cli.commands["interfaces"].commands["transceiver"].commands["presence"], ["Ethernet28"])
360360
expected = """Port Presence
361361
---------- ----------
362-
Ethernet28 Link Up
362+
Ethernet28 Port Up
363363
"""
364364
assert result.exit_code == 0
365365
assert result.output == expected
366366

367367
result = runner.invoke(show.cli.commands["interfaces"].commands["transceiver"].commands["presence"], ["Ethernet29"])
368368
expected = """Port Presence
369369
---------- ----------
370-
Ethernet29 Link Down
370+
Ethernet29 Port Down
371371
"""
372372
assert result.exit_code == 0
373373
assert result.output == expected
374374

375375
result = runner.invoke(show.cli.commands["interfaces"].commands["transceiver"].commands["presence"], ["Ethernet36"])
376376
expected = """Port Presence
377377
---------- ----------
378-
Ethernet36 Link Up
378+
Ethernet36 Port Up
379379
"""
380380
assert result.exit_code == 0
381381
assert result.output == expected

0 commit comments

Comments
 (0)