[console][minigraph] Avoid generate config for self console port (#7817)

Signed-off-by: Jing Kan jika@microsoft.com
This commit is contained in:
Blueve 2021-06-16 16:07:07 +08:00 committed by GitHub
parent 9f4359804e
commit 0096765eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -198,18 +198,18 @@ def parse_png(png, hname, dpg_ecmp_content = None):
startport = link.find(str(QName(ns, "StartPort"))).text
baudrate = link.find(str(QName(ns, "Bandwidth"))).text
flowcontrol = 1 if link.find(str(QName(ns, "FlowControl"))) is not None and link.find(str(QName(ns, "FlowControl"))).text == 'true' else 0
if enddevice.lower() == hname.lower():
if enddevice.lower() == hname.lower() and endport.isdigit():
console_ports[endport] = {
'remote_device': startdevice,
'baud_rate': baudrate,
'flow_control': flowcontrol
}
else:
}
elif startport.isdigit():
console_ports[startport] = {
'remote_device': enddevice,
'baud_rate': baudrate,
'flow_control': flowcontrol
}
}
continue
if linktype == "DeviceInterfaceLink":

View File

@ -194,6 +194,15 @@
</DpgDec>
<PngDec>
<DeviceInterfaceLinks>
<DeviceLinkBase i:type="DeviceSerialLink">
<ElementType>DeviceSerialLink</ElementType>
<Bandwidth>9600</Bandwidth>
<EndDevice>switch-t0</EndDevice>
<EndPort>console</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>switch-t1</StartDevice>
<StartPort>1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceSerialLink">
<ElementType>DeviceSerialLink</ElementType>
<Bandwidth>9600</Bandwidth>