From 394aa5f75f032862e379fe965e6ce9cf6e988d41 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Tue, 25 Aug 2020 09:33:43 -0700 Subject: [PATCH] Platform monitor changes in daemon_base for multi_asic (#4932) Adding namespace support for db connect API. --- src/sonic-py-common/sonic_py_common/daemon_base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sonic-py-common/sonic_py_common/daemon_base.py b/src/sonic-py-common/sonic_py_common/daemon_base.py index 6a2c6a22d2aa..97bf3011b6e4 100644 --- a/src/sonic-py-common/sonic_py_common/daemon_base.py +++ b/src/sonic-py-common/sonic_py_common/daemon_base.py @@ -13,13 +13,16 @@ 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 ===================================================================