Handle NotImplementedError exception while changing optoe write max#2985
Merged
prgeor merged 4 commits intosonic-net:masterfrom Sep 19, 2023
Merged
Conversation
Signed-off-by: Mihir Patel <[email protected]>
…into get_eeprom_path_exception_handling
prgeor
approved these changes
Sep 19, 2023
Contributor
|
@yxieca @StormLiangMS please cherry pick to 202205 and 202305 |
Contributor
Author
ADO - 25173918 |
StormLiangMS
pushed a commit
that referenced
this pull request
Sep 21, 2023
…2985) * Handle NotImplementedError exception while changing optoe write max Signed-off-by: Mihir Patel <[email protected]> * Added unit test for more coverage * Removed unused import --------- Signed-off-by: Mihir Patel <[email protected]>
yxieca
pushed a commit
that referenced
this pull request
Sep 26, 2023
…2985) * Handle NotImplementedError exception while changing optoe write max Signed-off-by: Mihir Patel <[email protected]> * Added unit test for more coverage * Removed unused import --------- Signed-off-by: Mihir Patel <[email protected]>
JunhongMao
pushed a commit
to JunhongMao/sonic-utilities
that referenced
this pull request
Oct 4, 2023
…onic-net#2985) * Handle NotImplementedError exception while changing optoe write max Signed-off-by: Mihir Patel <[email protected]> * Added unit test for more coverage * Removed unused import --------- Signed-off-by: Mihir Patel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
For platforms which do not implement get_eeprom_path API, NotImplementedError will be returned when the user downloads CDB firmware through "sfputil firmware download <port> <fw_path>" CLI.
We need to handle such case and allow FW download to proceed since the corresponding platform may not support Optoe driver or may not have get_eeprom_path not implemented.
https://github.com/sonic-net/sonic-utilities/blob/572902878cf4bb3345de37791d231456b9df95cb/sfputil/main.py#L1328C4-L1328C52
get_eeprom_path API related code
https://github.com/sonic-net/sonic-platform-common/blob/master/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py#L169
https://github.com/sonic-net/sonic-platform-common/blob/master/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py#L148
How I did it
Handling NotImplementedError exception now while calling set_optoe_write_max API to allow FW download.
How to verify it
The "sfputil firmware download <fw_path>" CLI was verified successfully in the following scenarios
Previous command output (if the output of a command-line utility has changed)
Error seen while initiating FW download when get_eeprom_path is not defined
New command output (if the output of a command-line utility has changed)