Skip to content

Commit 394aa5f

Browse files
authored
Platform monitor changes in daemon_base for multi_asic (sonic-net#4932)
Adding namespace support for db connect API.
1 parent 834a29c commit 394aa5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
EEPROM_MODULE_NAME = 'eeprom'
1414
EEPROM_CLASS_NAME = 'board'
1515

16+
# The empty namespace refers to linux host namespace.
17+
EMPTY_NAMESPACE = ''
18+
1619
#
1720
# Helper functions =============================================================
1821
#
1922

20-
def db_connect(db_name):
23+
def db_connect(db_name, namespace=EMPTY_NAMESPACE):
2124
from swsscommon import swsscommon
22-
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True)
25+
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True, namespace)
2326

2427
#
2528
# DaemonBase ===================================================================

0 commit comments

Comments
 (0)