-
Notifications
You must be signed in to change notification settings - Fork 661
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
modifying psushow script to use key names instead of index #3208
base: master
Are you sure you want to change the base?
Conversation
@gregoryboudreau from user perspective isn't the previous output easily readable compared to your proposal? |
It depends. Having enumerated names can make it "readable" but provides minimal information about the actual device. By using the vendor defined name (if available), we can provide more accurate and contextual information for the user in the same way we do for fans/fantrays. The enumerated names can also cause confusion as the PSU enumeration != PSU index and may != PSU name. It is better to organize these under a simple and vendor implemented manner, same as fan trays. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@gregoryboudreau could you please add the corresponding unit test to: sonic-utilities/tests/psushow_test.py ? It is currently testing the old format. |
@gregoryboudreau could you please run test_psu*.py from sonic-mgmt test and attach the result to PR? |
will update test and attach logs for test_psu |
What I did
Change psushow to use key names under the
PSU_INFO|*
banner for clarity instead of via indexing method as was done previously.How I did it
As stated above, query for keys in a sorted manner and grab/display information like that instead of grabbing information based on PSU index
How to verify it
Run
psushow
command (or its SONiC maskshow platform psustatus
)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)
Related PRs:
sonic-net/sonic-mgmt#11944
sonic-net/sonic-platform-daemons#446
sonic-net/sonic-snmpagent#312