add sfp get error description (#13275) (#13746)

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"

Co-authored-by: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com>
This commit is contained in:
mssonicbld 2023-02-11 06:37:32 +08:00 committed by GitHub
parent 0af9feb2ec
commit ff232d67bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -974,3 +974,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