Skip to content

Commit 3b07479

Browse files
prsunnyqiluo-msft
authored andcommitted
Remove prefix "oid:0x" from sai oid (#18)
1 parent a21b7a9 commit 3b07479

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/swsssdk/port_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def get_interface_oid_map(db):
3838
"""
3939
db.connect('COUNTERS_DB')
4040
if_name_map = db.get_all('COUNTERS_DB', 'COUNTERS_PORT_NAME_MAP', blocking=True)
41+
oid_pfx = len("oid:0x")
42+
if_name_map = {if_name: sai_oid[oid_pfx:] for if_name, sai_oid in if_name_map.items()}
43+
4144
if_id_map = {sai_oid: if_name for if_name, sai_oid in if_name_map.items()
4245
# only map the interface if it's a style understood to be a SONiC interface.
4346
if get_index(if_name) is not None}

0 commit comments

Comments
 (0)