Skip to content

Commit

Permalink
[snmp] Allow system with no ports in config db run without errors
Browse files Browse the repository at this point in the history
Signed-off-by: liora <[email protected]>
  • Loading branch information
liorghub committed Jul 25, 2021
1 parent f21641e commit 49188ec
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def init_sync_d_interface_tables(db_conn):

# { if_name (SONiC) -> sai_id }
# ex: { "Ethernet76" : "1000000000023" }
if_name_map_util, if_id_map_util = port_util.get_interface_oid_map(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 \
Expand Down Expand Up @@ -351,9 +351,7 @@ def init_sync_d_queue_tables(db_conn):

# { Port name : Queue index (SONiC) -> sai_id }
# ex: { "Ethernet0:2" : "1000000000023" }
queue_name_map = {}
if db_conn.exists(COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP):
queue_name_map = db_conn.get_all(COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP, blocking=True)
queue_name_map = db_conn.get_all(COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP, blocking=False)
logger.debug("Queue name map:\n" + pprint.pformat(queue_name_map, indent=2))

# Parse the queue_name_map and create the following maps:
Expand Down

0 comments on commit 49188ec

Please sign in to comment.