[minigraph.py]: Remove prefix length from peer switch loopback address (#6174)
* PEER_SWITCH table in config DB expects a standalone IP address w/o a prefix length Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
This commit is contained in:
parent
b2a3de5f4f
commit
fd4433d836
@ -67,8 +67,10 @@ def get_peer_switch_info(link_metadata, devices):
|
|||||||
if "PeerSwitch" in data:
|
if "PeerSwitch" in data:
|
||||||
peer_hostname = data["PeerSwitch"]
|
peer_hostname = data["PeerSwitch"]
|
||||||
peer_lo_addr = devices[peer_hostname]["lo_addr"]
|
peer_lo_addr = devices[peer_hostname]["lo_addr"]
|
||||||
|
peer_lo_addr = ipaddress.ip_network(UNICODE_TYPE(peer_lo_addr))
|
||||||
|
|
||||||
peer_switch_table[peer_hostname] = {
|
peer_switch_table[peer_hostname] = {
|
||||||
'address_ipv4': peer_lo_addr
|
'address_ipv4': str(peer_lo_addr.network_address)
|
||||||
}
|
}
|
||||||
|
|
||||||
return peer_switch_table
|
return peer_switch_table
|
||||||
|
@ -268,7 +268,7 @@
|
|||||||
<Devices>
|
<Devices>
|
||||||
<Device i:type="ToRRouter">
|
<Device i:type="ToRRouter">
|
||||||
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
||||||
<d5p1:IPPrefix>26.1.1.10</d5p1:IPPrefix>
|
<d5p1:IPPrefix>26.1.1.10/32</d5p1:IPPrefix>
|
||||||
</Address>
|
</Address>
|
||||||
<Hostname>switch-t0</Hostname>
|
<Hostname>switch-t0</Hostname>
|
||||||
<HwSku>Force10-S6000</HwSku>
|
<HwSku>Force10-S6000</HwSku>
|
||||||
@ -276,7 +276,7 @@
|
|||||||
</Device>
|
</Device>
|
||||||
<Device i:type="ToRRouter">
|
<Device i:type="ToRRouter">
|
||||||
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
||||||
<d5p1:IPPrefix>25.1.1.10</d5p1:IPPrefix>
|
<d5p1:IPPrefix>25.1.1.10/32</d5p1:IPPrefix>
|
||||||
</Address>
|
</Address>
|
||||||
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
|
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
|
||||||
<a:IPPrefix>10.7.0.196/26</a:IPPrefix>
|
<a:IPPrefix>10.7.0.196/26</a:IPPrefix>
|
||||||
|
@ -153,7 +153,7 @@ class TestCfgGenCaseInsensitive(TestCase):
|
|||||||
},
|
},
|
||||||
'switch2-t0': {
|
'switch2-t0': {
|
||||||
'hwsku': 'Force10-S6000',
|
'hwsku': 'Force10-S6000',
|
||||||
'lo_addr': '25.1.1.10',
|
'lo_addr': '25.1.1.10/32',
|
||||||
'mgmt_addr': '10.7.0.196/26',
|
'mgmt_addr': '10.7.0.196/26',
|
||||||
'type': 'ToRRouter'
|
'type': 'ToRRouter'
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user