Skip to content

Commit

Permalink
Use port_util front panel regex instead of Ethernet
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar-talmon authored and Itamar Talmon committed Jan 12, 2023
1 parent 2654f4a commit b30347a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def init_sync_d_interface_tables(db_conn):
if_name_map_util, if_id_map_util = port_util.get_interface_oid_map(db_conn, blocking=False)
for if_name, sai_id in if_name_map_util.items():
if_name_str = if_name
if (re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name_str) or \
if (re.match(port_util.SONIC_FRONT_PANEL_RE_PATTERN, if_name_str) or \
re.match(port_util.SONIC_ETHERNET_BP_RE_PATTERN, if_name_str) or \
re.match(port_util.SONIC_ETHERNET_IB_RE_PATTERN, if_name_str)):
if_name_map[if_name] = sai_id
Expand All @@ -277,7 +277,7 @@ def init_sync_d_interface_tables(db_conn):
# string or in sai id.
# sai_id_key = namespace : sai_id
for sai_id, if_name in if_id_map_util.items():
if (re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name) or \
if (re.match(port_util.SONIC_FRONT_PANEL_RE_PATTERN, if_name) or \
re.match(port_util.SONIC_ETHERNET_BP_RE_PATTERN, if_name) or \
re.match(port_util.SONIC_ETHERNET_IB_RE_PATTERN, if_name)):
if_id_map[get_sai_id_key(db_conn.namespace, sai_id)] = if_name
Expand All @@ -298,7 +298,7 @@ def init_sync_d_interface_tables(db_conn):
elif len(if_id_map) < len(if_name_map) or len(oid_name_map) < len(if_name_map):
# a length mismatch indicates a bad interface name
logger.warning("SyncD database contains incoherent interface names. Interfaces must match pattern '{}'"
.format(port_util.SONIC_ETHERNET_RE_PATTERN))
.format(port_util.SONIC_FRONT_PANEL_RE_PATTERN))
logger.warning("Port name map:\n" + pprint.pformat(if_name_map, indent=2))


Expand Down

0 comments on commit b30347a

Please sign in to comment.