-
Notifications
You must be signed in to change notification settings - Fork 120
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
Updating SNMP implementation to handle change of PSU Keys #312
base: master
Are you sure you want to change the base?
Conversation
let's fix this and rerun, |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -70,7 +71,8 @@ def _get_psu_presence(self, psu_index): | |||
Get PSU presence | |||
:return: the presence of particular PSU | |||
""" | |||
psu_name = PSU_INFO_KEY_TEMPLATE.format(psu_index) | |||
psu_keys = natsorted(self.statedb.keys(self.statedb.STATE_DB, "PSU_INFO|*")) | |||
psu_name = psu_keys[psu_index-1].removeprefix("PSU_INFO|") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment, in line, 75 psu_name is actually not "psu_name", but it is the numerical value from psu name and is then used to get the psu key mibs.psu_info_table(psu_name).
Can we rename "psu_name" in line 75 or directly use "psu_keys[psu_index-1]" in line 75 instead of mibs.psu_info_table(psu_name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct in that the mibs.psu_info_table
is redundant as we already have the full key for redis, I will update this accordingly.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@gregoryboudreau , will there by any impact in rfc2737 or 3433 implementation which uses PSU_INFO?
|
@gregoryboudreau can you merge with latest master |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
definitely possible, didn't see that originally. Will take a look. |
- What I did
Modified snmp implementation of Cisco MIB to use updated format for psu keys instead of index of PSU
- How I did it
Used a consistently sorted list of keys to allow for the modified statedb key naming for psus
- How to verify it
Ran the associated sonic-mgmt tests for PSUs (phy_entity and snmp_psu)
- Description for the changelog
Modifies SNMP implementation of Cisco PSUs to use key names instead of simple indexing
Related PRs:
sonic-net/sonic-mgmt#11944
sonic-net/sonic-utilities#3208
sonic-net/sonic-platform-daemons#446