Replace swsssdk.ConfigDBConnector and SonicDBConfig with swsscommon implementation in system-health (#8186)

swsssdk will be deprecated. Use swsscommon instead.
This commit is contained in:
Qi Luo 2021-07-16 19:56:24 -07:00 committed by GitHub
parent aca80a685c
commit ec624e280c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 6 deletions

View File

@ -3,7 +3,7 @@
SYSTEM_HEALTH = system_health-1.0-py3-none-any.whl
$(SYSTEM_HEALTH)_SRC_PATH = $(SRC_PATH)/system-health
$(SYSTEM_HEALTH)_PYTHON_VERSION = 3
$(SYSTEM_HEALTH)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SWSSSDK_PY3) $(SONIC_CONFIG_ENGINE_PY3)
$(SYSTEM_HEALTH)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_CONFIG_ENGINE_PY3)
SONIC_PYTHON_WHEELS += $(SYSTEM_HEALTH)
export system_health_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SYSTEM_HEALTH))"

View File

@ -1,5 +1,5 @@
from natsort import natsorted
from swsssdk import SonicV2Connector
from swsscommon.swsscommon import SonicV2Connector
from .health_checker import HealthChecker

View File

@ -9,7 +9,7 @@ import signal
import threading
from sonic_py_common.daemon_base import DaemonBase
from swsssdk import SonicV2Connector
from swsscommon.swsscommon import SonicV2Connector
from health_checker.manager import HealthCheckerManager

View File

@ -3,7 +3,6 @@ from setuptools import setup
dependencies = [
'natsort',
'sonic_py_common',
'swsssdk>=2.0.1',
]
setup(

View File

@ -10,14 +10,14 @@
"""
import os
import sys
import swsssdk
from swsscommon import swsscommon
from mock import Mock, MagicMock, patch
from sonic_py_common import device_info
from .mock_connector import MockConnector
swsssdk.SonicV2Connector = MockConnector
swsscommon.SonicV2Connector = MockConnector
test_path = os.path.dirname(os.path.abspath(__file__))
modules_path = os.path.dirname(test_path)