From 9f693339a485597d75e3380397701e6542c90c83 Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Wed, 20 Apr 2022 23:05:32 +0000 Subject: [PATCH] Fix lgtm error and fix load_db config function calls. Signed-off-by: Suvarna Meenakshi --- src/sonic-config-engine/portconfig.py | 1 - src/sonic-config-engine/sonic-cfggen | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index 89f87804c4b8..ea9985a3beb0 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -8,7 +8,6 @@ from swsscommon import swsscommon from sonic_py_common import device_info from sonic_py_common.multi_asic import get_asic_id_from_name - from sonic_py_common import multi_asic except ImportError as e: raise ImportError("%s - required module not found" % str(e)) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index cbe6d29c117e..b10002c40809 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -32,7 +32,7 @@ from functools import partial from minigraph import minigraph_encoder, parse_xml, parse_device_desc_xml, parse_asic_sub_role, parse_asic_switch_type from portconfig import get_port_config, get_breakout_mode from redis_bcc import RedisBytecodeCache -from sonic_py_common.multi_asic import get_asic_id_from_name, get_asic_device_id +from sonic_py_common.multi_asic import get_asic_id_from_name, get_asic_device_id, is_multi_asic from sonic_py_common import device_info from swsscommon.swsscommon import SonicV2Connector, ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector @@ -310,11 +310,11 @@ def main(): } }) # load db config - if not swsscommon.SonicDBConfig.isInit(): - if multi_asic.is_multi_asic(): - swsscommon.SonicDBConfig.load_sonic_global_db_config(namespace=asic_name) + if not SonicDBConfig.isInit(): + if is_multi_asic(): + SonicDBConfig.load_sonic_global_db_config(namespace=asic_name) else: - swsscommon.SonicDBConfig.load_sonic_db_config() + SonicDBConfig.load_sonic_db_config() if hwsku is not None: hardware_data = {'DEVICE_METADATA': {'localhost': { 'hwsku': hwsku