Skip to content

Commit 000f89b

Browse files
keboliumssonicbld
authored andcommitted
get_error_description should return 'OK' instead of None when there is no error (#518)
- Description The "get_error_description" function should return 'OK' instead of 'None' when there are no errors. - Motivation and Context When there are no errors on the cable, get_error_description currently returns 'None'. In this case, we should return 'OK' so that the CLI (show interface transceiver error-description) provides a proper output. - How Has This Been Tested? Call this API directly on different cables with different error statuses. Signed-off-by: Kebo Liu <kebol@nvidia.com>
1 parent 101fe2e commit 000f89b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sonic_platform_base/sonic_xcvr/api/public/cmis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,6 +2724,6 @@ def get_error_description(self):
27242724
if state != CmisCodes.MODULE_STATE[3]:
27252725
return state
27262726

2727-
return None
2727+
return 'OK'
27282728

27292729
# TODO: other XcvrApi methods

tests/sonic_xcvr/test_cmis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2664,7 +2664,7 @@ def test_get_error_description(self):
26642664
self.api.xcvr_eeprom.read.return_value = 0x10
26652665

26662666
result = self.api.get_error_description()
2667-
assert result is None
2667+
assert result is 'OK'
26682668

26692669
def test_random_read_fail(self):
26702670
def mock_read_raw(offset, size):

0 commit comments

Comments
 (0)