Skip to content

Commit bd30ff2

Browse files
authored
Use swsscommon.DBConnector
1 parent feb8628 commit bd30ff2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sonic-py-common/sonic_py_common/multi_asic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,13 @@ def get_asic_presence_list():
497497
if not is_supervisor():
498498
# This is not supervisor, all asics should be present. Assuming that asics
499499
# are not removable entity on Line Cards. Add all asics, 0 - num_asics to the list.
500-
asics_list = list(range(0,get_num_asics()))
500+
asics_list = list(range(0, get_num_asics()))
501501
else:
502502
# This is supervisor card. Some fabric cards may not be inserted.
503503
# Get asic list from CHASSIS_ASIC_TABLE which lists only the asics
504504
# present based on Fabric card detection by the platform.
505-
db = daemon_base.db_connect(CHASSIS_STATE_DB)
506-
asic_table = swsscommon.Table(db,CHASSIS_ASIC_INFO_TABLE)
505+
db = swsscommon.DBConnector(CHASSIS_STATE_DB, 0, True)
506+
asic_table = swsscommon.Table(db, CHASSIS_ASIC_INFO_TABLE)
507507
if asic_table:
508508
asics_presence_list = list(asic_table.getKeys())
509509
for asic in asics_presence_list:

0 commit comments

Comments
 (0)