diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index 788774d34969..b2550b12125f 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -430,7 +430,8 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): if child_port in hwsku_entry: for key, item in hwsku_entry[child_port].items(): if key in OPTIONAL_HWSKU_ATTRIBUTES: - child_ports.get(child_port)[key] = item + for child in child_ports: + child_ports.get(child)[key] = item ports.update(child_ports) diff --git a/src/sonic-config-engine/tests/sample_output/platform_output.json b/src/sonic-config-engine/tests/sample_output/platform_output.json index 51c26754e982..b820717499a1 100644 --- a/src/sonic-config-engine/tests/sample_output/platform_output.json +++ b/src/sonic-config-engine/tests/sample_output/platform_output.json @@ -976,7 +976,8 @@ "alias": "Eth36/1", "pfc_asym": "off", "subport": "1", - "speed": "25000" + "speed": "25000", + "role": "Dpc" }, "Ethernet141": { "index": "36", @@ -987,7 +988,8 @@ "alias": "Eth36/2", "pfc_asym": "off", "speed": "25000", - "subport": "2" + "subport": "2", + "role": "Dpc" }, "Ethernet142": { "index": "36",