From e3a881e0b0d8a6365df57c2a272b9a300fcede6a Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Wed, 20 Apr 2022 00:36:28 +0000 Subject: [PATCH 1/2] [multi-asic]: Skip must field check in config_db for default namepsace in multi-asic platform. Signed-off-by: Suvarna Meenakshi --- src/sonic-config-engine/sonic-cfggen | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index aebd4d0544f5..f26ade73e47f 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -349,7 +349,10 @@ def main(): else: deep_update(data, parse_xml(minigraph, port_config_file=args.port_config, asic_name=asic_name, hwsku_config_file=args.hwsku_config)) # check if minigraph parser has speed and lanes in PORT table - _must_field_by_yang(data, 'PORT', ['speed', 'lanes']) + # speed and lanes will not be present for default namespace for + # multi-asic platform. + if not is_multi_asic() or asic_name: + _must_field_by_yang(data, 'PORT', ['speed', 'lanes']) if args.device_description is not None: deep_update(data, parse_device_desc_xml(args.device_description)) From 271527b999a6d03e2b2ec05af02ea922220baeca Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Wed, 20 Apr 2022 22:39:47 +0000 Subject: [PATCH 2/2] Import new function used. Signed-off-by: Suvarna Meenakshi --- src/sonic-config-engine/sonic-cfggen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index f26ade73e47f..1efa4cced820 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