Skip to content

Commit 3ebedde

Browse files
committed
Fix StartPort name in test case
Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
1 parent 8e0e2d6 commit 3ebedde

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/sonic-config-engine/minigraph.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ def parse_png(png, hname):
7878
bandwidth = bandwidth_node.text if bandwidth_node is not None else None
7979

8080
if enddevice == hname:
81-
if bandwidth:
82-
port_speeds[endport] = bandwidth
8381
if port_alias_map.has_key(endport):
8482
endport = port_alias_map[endport]
8583
neighbors[endport] = {'name': startdevice, 'port': startport}
86-
else:
8784
if bandwidth:
88-
port_speeds[startport] = bandwidth
85+
port_speeds[endport] = bandwidth
86+
else:
8987
if port_alias_map.has_key(startport):
9088
startport = port_alias_map[startport]
9189
neighbors[startport] = {'name': enddevice, 'port': endport}
90+
if bandwidth:
91+
port_speeds[startport] = bandwidth
9292

9393
if child.tag == str(QName(ns, "Devices")):
9494
for device in child.findall(str(QName(ns, "Device"))):

src/sonic-config-engine/tests/simple-sample-graph.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
<EndPort>et1</EndPort>
191191
<FlowControl>true</FlowControl>
192192
<StartDevice>switch-t0</StartDevice>
193-
<StartPort>Ethernet8</StartPort>
193+
<StartPort>fortyGigE0/8</StartPort>
194194
<Validate>true</Validate>
195195
</DeviceLinkBase>
196196
</DeviceInterfaceLinks>

0 commit comments

Comments
 (0)