Skip to content

Commit

Permalink
Platform monitor changes in daemon_base for multi_asic (sonic-net#4932)
Browse files Browse the repository at this point in the history
Adding namespace support for db connect API.
  • Loading branch information
judyjoseph authored Aug 25, 2020
1 parent 834a29c commit 394aa5f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sonic-py-common/sonic_py_common/daemon_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===================================================================
Expand Down

0 comments on commit 394aa5f

Please sign in to comment.