Skip to content

Commit

Permalink
Fix lgtm error and fix load_db config function calls.
Browse files Browse the repository at this point in the history
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
  • Loading branch information
SuvarnaMeenakshi committed Apr 20, 2022
1 parent 8f26eb9 commit 9f69333
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/sonic-config-engine/portconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
10 changes: 5 additions & 5 deletions src/sonic-config-engine/sonic-cfggen
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9f69333

Please sign in to comment.