From 850e45601bc7672462418dea194cee36b04cf811 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Tue, 26 Apr 2022 17:26:44 -0700 Subject: [PATCH] Revert "[sonic-cfggen] make minigraph parser fail when speed and lanes are not in PORT table (#10228)" (#10683) This reverts commit cd330f0e70e646c2ff6fc88c6c8fb9f75e8b40e7. --- src/sonic-config-engine/sonic-cfggen | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index b10002c408..3f0e047f76 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -247,19 +247,6 @@ def _get_jinja2_env(paths): return env -def _must_field_by_yang(data, table, must_fields): - """ - Check if table contains must field based on yang definition - """ - if table not in data: - return - - for must_field in must_fields: - for _, fields in data[table].items(): - if must_field not in fields: - print(must_field, 'is a must field in', table, file=sys.stderr) - sys.exit(1) - def main(): parser=argparse.ArgumentParser(description="Render configuration file from minigraph data and jinja2 template.") group = parser.add_mutually_exclusive_group() @@ -354,8 +341,6 @@ def main(): deep_update(data, parse_xml(minigraph, platform, asic_name=asic_name)) 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']) if args.device_description is not None: deep_update(data, parse_device_desc_xml(args.device_description))