-
Notifications
You must be signed in to change notification settings - Fork 92
Remove prefix "oid:0x" from sai oid #18
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ def get_interface_oid_map(db): | |
| """ | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
|
|
||
| if_id_map = {sai_oid: if_name for if_name, sai_oid in if_name_map.items() | ||
| # only map the interface if it's a style understood to be a SONiC interface. | ||
| if get_index(if_name) is not None} | ||
|
|
||
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.
sai_oid.split(':')[1]
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.
We would want to split till 0x.