Skip to content

Commit

Permalink
Two fixes:
Browse files Browse the repository at this point in the history
a) we should use get_platform() with new sonic_py-common package
b) In 201911 DB Connector is still using db id based constructor
as following PR sonic-net#4549
is not cherry-picked yet. So revert the change to use db is insatead of
db_name for now.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi committed Aug 15, 2020
1 parent 13e260b commit 8ece4e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 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 @@ -8,18 +8,25 @@
#
# Constants ====================================================================
#
# Redis DB information
REDIS_HOSTNAME = 'localhost'
REDIS_PORT = 6379
REDIS_TIMEOUT_MSECS = 0


EEPROM_MODULE_NAME = 'eeprom'
EEPROM_CLASS_NAME = 'board'

#
# Helper functions =============================================================
#

def db_connect(db_name):
def db_connect(db):
from swsscommon import swsscommon
return swsscommon.DBConnector(db_name, REDIS_TIMEOUT_MSECS, True)
return swsscommon.DBConnector(db,
REDIS_HOSTNAME,
REDIS_PORT,
REDIS_TIMEOUT_MSECS)

#
# DaemonBase ===================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_npu_id_from_name(npu_name):


def get_npu_device_id(npu_id):
platform = get_platform_info(get_machine_info())
platform = get_platform()
if not platform:
return None

Expand Down

0 comments on commit 8ece4e0

Please sign in to comment.