diff --git a/dockers/docker-orchagent/ports.json.j2 b/dockers/docker-orchagent/ports.json.j2 index e043899811..fe3e37f9b3 100644 --- a/dockers/docker-orchagent/ports.json.j2 +++ b/dockers/docker-orchagent/ports.json.j2 @@ -1,7 +1,6 @@ [ {% if PORT %} {% for port in PORT %} -{% if PORT[port].has_key('speed') %} { "PORT_TABLE:{{ port }}": { "speed": "{{ PORT[port]['speed'] }}", @@ -10,7 +9,6 @@ "OP": "SET" }{% if not loop.last %},{% endif %} -{% endif %} {% endfor %} {% endif %} ] diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index f33bd11f0b..00a4c609ad 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -398,10 +398,13 @@ def parse_xml(filename, platform=None, port_config_file=None): results['VLAN_INTERFACE'] = vlan_intfs results['PORTCHANNEL_INTERFACE'] = pc_intfs + # TODO: the speed (if exits) in port_config.ini shall align with the speed in minigraph for port_name in port_speeds: ports.setdefault(port_name, {})['speed'] = port_speeds[port_name] for port_name in port_descriptions: ports.setdefault(port_name, {})['description'] = port_descriptions[port_name] + # if the speed is not defined, the port shall be removed from the ports list + ports = { key: value for key, value in ports.iteritems() if 'speed' in value.keys() } results['PORT'] = ports results['PORTCHANNEL'] = pcs