Platform monitor changes in daemon_base for multi_asic (#4932)

Adding namespace support for db connect API.
This commit is contained in:
judyjoseph 2020-08-25 09:33:43 -07:00 committed by GitHub
parent 834a29cb66
commit 394aa5f75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,13 +13,16 @@ REDIS_TIMEOUT_MSECS = 0
EEPROM_MODULE_NAME = 'eeprom'
EEPROM_CLASS_NAME = 'board'
# The empty namespace refers to linux host namespace.
EMPTY_NAMESPACE = ''
#
# Helper functions =============================================================
#
def db_connect(db_name):
def db_connect(db_name, namespace=EMPTY_NAMESPACE):
from swsscommon import swsscommon
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True)
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True, namespace)
#
# DaemonBase ===================================================================