add sfp get error description (#13275)

Why I did it
Command "sudo sfputil show error-status -hw" shows "OK (Not implemented)" in the output.

How I did it
Add a new SFP API get_error_description support in Nokia sonic-platform sfp.py module.

How to verify it
Run the new image and execute command "sudo sfputil show error-status -hw"
This commit is contained in:
Pavan-Nokia 2023-02-09 16:17:57 -05:00 committed by GitHub
parent dd7948bf17
commit e98927f354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -969,3 +969,20 @@ class Sfp(SfpBase):
integer: The 1-based relative physical position in parent device
"""
return self.index
def get_error_description(self):
"""
Retrives the error descriptions of the SFP module
Returns:
String that represents the current error descriptions of vendor specific errors
In case there are multiple errors, they should be joined by '|',
like: "Bad EEPROM|Unsupported cable"
"""
if not self.get_presence():
error_description = self.SFP_STATUS_UNPLUGGED
else:
error_description = self.SFP_STATUS_OK
return error_description