Allow sfputil page parsing to accept decimal, hex and octals#4444
Open
maheeppartap-nexthop wants to merge 2 commits intosonic-net:masterfrom
Open
Allow sfputil page parsing to accept decimal, hex and octals#4444maheeppartap-nexthop wants to merge 2 commits intosonic-net:masterfrom
maheeppartap-nexthop wants to merge 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: maheeppartap-nexthop <[email protected]>
Signed-off-by: Maheeppartap Singh <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Fixes sonic-net/sonic-platform-common#648
What I did
Passing page number to sfputil currently assumes all inputs are hex values.
sudo sfputil read-eeprom -p Ethernet92 -n 17 -o 128 -s 128would use page 23, instead of 17.This PR aims to make the user's intent more clean, and is now able to clearly distinguish between hex, int, octal values.
sudo sfputil read-eeprom -p Ethernet92 -n 17 -o 128 -s 128would should use page 17sudo sfputil read-eeprom -p Ethernet92 -n 0x17 -o 128 -s 128would should use page 23sudo sfputil read-eeprom -p Ethernet92 -n 0o17 -o 128 -s 128would should use page 15How I did it
inside
validatre_eeprom_page, I changed the base from 16 to 0. I also updated the help messages and error messages to make the new behaviour more clear.How to verify it
You can try running the same command with other types.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)