allow data_dict to exclude drawer_name #3119
Open
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
I adjusted
fanshow
to accommodate a missingdrawer_name
key in thedata_dict
.How I did it
On my Dell N3248TE-ON, if only one of my PSUs is active,
show platform fan
generates a Python error due to a missingDRAWER_FIELD_NAME
(set todrawer_name
earlier) value in thedata_dict
that is built from theSTATE_DB
. I'm not sure if this is a peculiarity of the Dell unit or if it's more common. If I should adjust something in the Dell platform scripts instead, let me know.How to verify it
show platform fan
no longer generates a Python exception when only one PSU is active.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)
It seems like maybe more work is required on this since
Status
should probably not sayOK
. But at least it doesn't throw an exception now.