[multi-asic]: remove load_sonic_global_db_config calls (#8173)
#### Why I did it Remove the call to `SonicDBConfig.load_sonic_global_db_config()` in the multi asic functions. The expection is the client calling this function will call `SonicDBConfig.load_sonic_global_db_config()` This PR is dependent on the PR https://github.com/Azure/sonic-utilities/pull/1712 #### How to verify it compile sonic-utilities
This commit is contained in:
parent
4536f35f26
commit
78c31722e9
@ -18,7 +18,7 @@ try:
|
||||
import threading
|
||||
import time
|
||||
|
||||
from sonic_py_common import daemon_base, device_info
|
||||
from sonic_py_common import daemon_base, device_info, multi_asic
|
||||
from swsscommon import swsscommon
|
||||
except ImportError as err:
|
||||
raise ImportError("%s - required module not found" % str(err))
|
||||
@ -108,7 +108,7 @@ class ControlPlaneAclManager(daemon_base.DaemonBase):
|
||||
self.namespace_docker_mgmt_ip = {}
|
||||
self.namespace_docker_mgmt_ipv6 = {}
|
||||
|
||||
namespaces = device_info.get_all_namespaces()
|
||||
namespaces = multi_asic.get_all_namespaces()
|
||||
for front_asic_namespace in namespaces['front_ns']:
|
||||
self.update_thread[front_asic_namespace] = None
|
||||
self.lock[front_asic_namespace] = threading.Lock()
|
||||
|
@ -3,9 +3,7 @@ import os
|
||||
import subprocess
|
||||
|
||||
from natsort import natsorted
|
||||
from swsssdk import ConfigDBConnector
|
||||
from swsssdk import SonicDBConfig
|
||||
from swsssdk import SonicV2Connector
|
||||
from swsscommon import swsscommon
|
||||
|
||||
from .device_info import CONTAINER_PLATFORM_PATH
|
||||
from .device_info import HOST_DEVICE_PATH
|
||||
@ -39,8 +37,7 @@ def connect_config_db_for_ns(namespace=DEFAULT_NAMESPACE):
|
||||
Returns:
|
||||
handle to the config_db for a namespace
|
||||
"""
|
||||
SonicDBConfig.load_sonic_global_db_config()
|
||||
config_db = ConfigDBConnector(namespace=namespace)
|
||||
config_db = swsscommon.ConfigDBConnector(namespace=namespace)
|
||||
config_db.connect()
|
||||
return config_db
|
||||
|
||||
@ -58,8 +55,7 @@ def connect_to_all_dbs_for_ns(namespace=DEFAULT_NAMESPACE):
|
||||
Returns:
|
||||
handle to all the dbs for a namespaces
|
||||
"""
|
||||
SonicDBConfig.load_sonic_global_db_config()
|
||||
db = SonicV2Connector(namespace=namespace)
|
||||
db = swsscommon.SonicV2Connector(namespace=namespace)
|
||||
for db_id in db.get_db_list():
|
||||
db.connect(db_id)
|
||||
return db
|
||||
|
Loading…
Reference in New Issue
Block a user