Add support to parse bandwidth for DeviceMgmtLinks (#7883)
Add support to parse bandwidth for DeviceMgmtLinks
This commit is contained in:
parent
86c2f4248c
commit
27fe654388
@ -119,7 +119,7 @@ def parse_png(png, hname):
|
|||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if linktype != "DeviceInterfaceLink" and linktype != "UnderlayInterfaceLink":
|
if linktype != "DeviceInterfaceLink" and linktype != "UnderlayInterfaceLink" and linktype != "DeviceMgmtLink":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
enddevice = link.find(str(QName(ns, "EndDevice"))).text
|
enddevice = link.find(str(QName(ns, "EndDevice"))).text
|
||||||
@ -131,12 +131,14 @@ def parse_png(png, hname):
|
|||||||
if enddevice.lower() == hname.lower():
|
if enddevice.lower() == hname.lower():
|
||||||
if port_alias_map.has_key(endport):
|
if port_alias_map.has_key(endport):
|
||||||
endport = port_alias_map[endport]
|
endport = port_alias_map[endport]
|
||||||
|
if linktype != "DeviceMgmtLink":
|
||||||
neighbors[endport] = {'name': startdevice, 'port': startport}
|
neighbors[endport] = {'name': startdevice, 'port': startport}
|
||||||
if bandwidth:
|
if bandwidth:
|
||||||
port_speeds[endport] = bandwidth
|
port_speeds[endport] = bandwidth
|
||||||
elif startdevice.lower() == hname.lower():
|
elif startdevice.lower() == hname.lower():
|
||||||
if port_alias_map.has_key(startport):
|
if port_alias_map.has_key(startport):
|
||||||
startport = port_alias_map[startport]
|
startport = port_alias_map[startport]
|
||||||
|
if linktype != "DeviceMgmtLink":
|
||||||
neighbors[startport] = {'name': enddevice, 'port': endport}
|
neighbors[startport] = {'name': enddevice, 'port': endport}
|
||||||
if bandwidth:
|
if bandwidth:
|
||||||
port_speeds[startport] = bandwidth
|
port_speeds[startport] = bandwidth
|
||||||
@ -1066,6 +1068,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None):
|
|||||||
print >> sys.stderr, "Warning: ignore interface '%s' as it is not in the port_config.ini" % port_name
|
print >> sys.stderr, "Warning: ignore interface '%s' as it is not in the port_config.ini" % port_name
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# skip management ports
|
||||||
|
if port_name in mgmt_alias_reverse_mapping.keys():
|
||||||
|
continue
|
||||||
|
|
||||||
ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name]
|
ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name]
|
||||||
|
|
||||||
for port_name, port in ports.items():
|
for port_name, port in ports.items():
|
||||||
|
@ -20,6 +20,13 @@
|
|||||||
},
|
},
|
||||||
"OP": "SET"
|
"OP": "SET"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PORT_TABLE:Ethernet16": {
|
||||||
|
"speed": "1000",
|
||||||
|
"description": "fortyGigE0/16"
|
||||||
|
},
|
||||||
|
"OP": "SET"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"PORT_TABLE:Ethernet12": {
|
"PORT_TABLE:Ethernet12": {
|
||||||
"speed": "100000",
|
"speed": "100000",
|
||||||
|
@ -267,6 +267,25 @@
|
|||||||
<StartPort>Ethernet1/33</StartPort>
|
<StartPort>Ethernet1/33</StartPort>
|
||||||
<Validate>true</Validate>
|
<Validate>true</Validate>
|
||||||
</DeviceLinkBase>
|
</DeviceLinkBase>
|
||||||
|
<DeviceLinkBase i:type="DeviceMgmtLink">
|
||||||
|
<ElementType>DeviceMgmtLink</ElementType>
|
||||||
|
<Bandwidth>1000</Bandwidth>
|
||||||
|
<EndDevice>switch-t0</EndDevice>
|
||||||
|
<EndPort>fortyGigE0/16</EndPort>
|
||||||
|
<FlowControl>true</FlowControl>
|
||||||
|
<StartDevice>ChassisMTS1</StartDevice>
|
||||||
|
<StartPort>mgmt0</StartPort>
|
||||||
|
<Validate>true</Validate>
|
||||||
|
</DeviceLinkBase>
|
||||||
|
<DeviceLinkBase i:type="DeviceMgmtLink">
|
||||||
|
<ElementType>DeviceMgmtLink</ElementType>
|
||||||
|
<Bandwidth>1000</Bandwidth>
|
||||||
|
<EndDevice>switch-t0</EndDevice>
|
||||||
|
<EndPort>Management1</EndPort>
|
||||||
|
<StartDevice>switch-m0</StartDevice>
|
||||||
|
<StartPort>Management1</StartPort>
|
||||||
|
<Validate>true</Validate>
|
||||||
|
</DeviceLinkBase>
|
||||||
</DeviceInterfaceLinks>
|
</DeviceInterfaceLinks>
|
||||||
<Devices>
|
<Devices>
|
||||||
<Device i:type="ToRRouter">
|
<Device i:type="ToRRouter">
|
||||||
@ -369,6 +388,18 @@
|
|||||||
<Speed>100000</Speed>
|
<Speed>100000</Speed>
|
||||||
<Description>Interface description</Description>
|
<Description>Interface description</Description>
|
||||||
</a:EthernetInterface>
|
</a:EthernetInterface>
|
||||||
|
<a:EthernetInterface>
|
||||||
|
<ElementType>DeviceInterface</ElementType>
|
||||||
|
<AlternateSpeeds i:nil="true"/>
|
||||||
|
<EnableFlowControl>true</EnableFlowControl>
|
||||||
|
<Index>1</Index>
|
||||||
|
<InterfaceName>fortyGigE0/16</InterfaceName>
|
||||||
|
<InterfaceType i:nil="true"/>
|
||||||
|
<MultiPortsInterface>false</MultiPortsInterface>
|
||||||
|
<PortName>0</PortName>
|
||||||
|
<Priority>0</Priority>
|
||||||
|
<Speed>100000</Speed>
|
||||||
|
</a:EthernetInterface>
|
||||||
</EthernetInterfaces>
|
</EthernetInterfaces>
|
||||||
<FlowControl>true</FlowControl>
|
<FlowControl>true</FlowControl>
|
||||||
<Height>0</Height>
|
<Height>0</Height>
|
||||||
|
@ -478,7 +478,7 @@ class TestCfgGen(TestCase):
|
|||||||
"'Ethernet4': {'lanes': '25,26,27,28', 'description': 'fortyGigE0/4', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000'}, "
|
"'Ethernet4': {'lanes': '25,26,27,28', 'description': 'fortyGigE0/4', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000'}, "
|
||||||
"'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, "
|
"'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, "
|
||||||
"'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, "
|
"'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, "
|
||||||
"'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, "
|
"'Ethernet16': {'lanes': '41,42,43,44', 'pfc_asym': 'off', 'description': 'fortyGigE0/16', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'speed': '1000'}, "
|
||||||
"'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, "
|
"'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, "
|
||||||
"'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, "
|
"'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, "
|
||||||
"'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, "
|
"'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, "
|
||||||
|
Loading…
Reference in New Issue
Block a user