Platform monitor changes in daemon_base for multi_asic (#4932)
Adding namespace support for db connect API.
This commit is contained in:
parent
89d22b57b1
commit
c06a9e4718
@ -15,13 +15,16 @@ REDIS_TIMEOUT_MSECS = 0
|
|||||||
EEPROM_MODULE_NAME = 'eeprom'
|
EEPROM_MODULE_NAME = 'eeprom'
|
||||||
EEPROM_CLASS_NAME = 'board'
|
EEPROM_CLASS_NAME = 'board'
|
||||||
|
|
||||||
|
# The empty namespace refers to linux host namespace.
|
||||||
|
EMPTY_NAMESPACE = ''
|
||||||
|
|
||||||
#
|
#
|
||||||
# Helper functions =============================================================
|
# Helper functions =============================================================
|
||||||
#
|
#
|
||||||
|
|
||||||
def db_connect(db_name):
|
def db_connect(db_name, namespace=EMPTY_NAMESPACE):
|
||||||
from swsscommon import swsscommon
|
from swsscommon import swsscommon
|
||||||
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True)
|
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True, namespace)
|
||||||
|
|
||||||
#
|
#
|
||||||
# DaemonBase ===================================================================
|
# DaemonBase ===================================================================
|
||||||
|
Reference in New Issue
Block a user