Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced - Handle the error status returned by platform APIs #26

Conversation

stephenxs
Copy link

In case there is an error returned by platform API

  • Translate the error bitmap to error description for generic errors
  • Fetch the error description from sfp_error dict or via calling platform API get_error_description for vendor specific errors
  • Adjust unit test cases

Signed-off-by: Stephen Sun [email protected]

Description

Motivation and Context

How Has This Been Tested?

Additional Information (Optional)

In case there is an error returned by platform API
- Translate the error bitmap to error description for generic errors
- Fetch the error description from sfp_error dict or via calling platform API get_error_description for vendor specific errors
- Adjust unit test cases

Signed-off-by: Stephen Sun <[email protected]>
if error in status_dict['error']:
return True
error = status_dict.get('error')
if SfpBase.SFP_ERROR_DESCRIPTION_BLOCKING in error:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return SfpBase.SFP_ERROR_DESCRIPTION_BLOCKING in error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

sonic-xcvrd/xcvrd/xcvrd.py Show resolved Hide resolved
Signed-off-by: Stephen Sun <[email protected]>
@Junchao-Mellanox Junchao-Mellanox merged commit f7b5949 into Junchao-Mellanox:sfp-bit-map Jun 8, 2021
@stephenxs stephenxs deleted the sfp-bit-map-error-status branch April 12, 2022 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants