Remove prefix "oid:0x" from sai oid#18
Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom Oct 25, 2017
Merged
Conversation
Contributor
Author
|
Changes to fix the side effects of sonic-net/sonic-sairedis#234 |
lguohan
reviewed
Oct 25, 2017
| db.connect('COUNTERS_DB') | ||
| if_name_map = db.get_all('COUNTERS_DB', 'COUNTERS_PORT_NAME_MAP', blocking=True) | ||
| oid_pfx = len("oid:0x") | ||
| if_name_map = {if_name: sai_oid[oid_pfx:] for if_name, sai_oid in if_name_map.items()} |
Contributor
Author
There was a problem hiding this comment.
We would want to split till 0x.
lguohan
approved these changes
Oct 25, 2017
stcheng
approved these changes
Oct 25, 2017
qiluo-msft
reviewed
Oct 25, 2017
| db.connect('COUNTERS_DB') | ||
| if_name_map = db.get_all('COUNTERS_DB', 'COUNTERS_PORT_NAME_MAP', blocking=True) | ||
| oid_pfx = len("oid:0x") | ||
| if_name_map = {if_name: sai_oid[oid_pfx:] for if_name, sai_oid in if_name_map.items()} |
Contributor
There was a problem hiding this comment.
sai_oid [](start = 28, length = 7)
This change will bring dependency on schema version. Suggest to make it backward compatible, so we can still update snmp docker in old switches.
Contributor
There was a problem hiding this comment.
there could be other changes in the counters_db or other new data in the database that is needed by new snmp. It will be very difficult to test all cases. Not sure we really need to have this as a goal.
qiluo-msft
approved these changes
Oct 25, 2017
praveen-li
pushed a commit
to praveen-li/sonic-py-swsssdk
that referenced
this pull request
May 4, 2021
* msft_github/master: Fix issue in get_table with zero-attribute table entries (sonic-net#20) Remove prefix "oid:0x" from sai oid (sonic-net#18) [port_util]: Return empty dictionary instead of a NoneType in get_bridge_port_map (sonic-net#17)
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.
With a recent change in COUNTERS_DB, the SAI OIDs are prefixed with "oid:0x". However, the current scripts/utils are indexing this using key without this prefix.
Changing to reflect the mapping as before.