[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:
Lawrence Lee 2020-12-10 14:43:39 -08:00 committed by GitHub
parent b2a3de5f4f
commit fd4433d836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -67,8 +67,10 @@ def get_peer_switch_info(link_metadata, devices):
if "PeerSwitch" in data:
peer_hostname = data["PeerSwitch"]
peer_lo_addr = devices[peer_hostname]["lo_addr"]
peer_lo_addr = ipaddress.ip_network(UNICODE_TYPE(peer_lo_addr))
peer_switch_table[peer_hostname] = {
'address_ipv4': peer_lo_addr
'address_ipv4': str(peer_lo_addr.network_address)
}
return peer_switch_table

View File

@ -268,7 +268,7 @@
<Devices>
<Device i:type="ToRRouter">
<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>
<Hostname>switch-t0</Hostname>
<HwSku>Force10-S6000</HwSku>
@ -276,7 +276,7 @@
</Device>
<Device i:type="ToRRouter">
<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>
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
<a:IPPrefix>10.7.0.196/26</a:IPPrefix>

View File

@ -153,7 +153,7 @@ class TestCfgGenCaseInsensitive(TestCase):
},
'switch2-t0': {
'hwsku': 'Force10-S6000',
'lo_addr': '25.1.1.10',
'lo_addr': '25.1.1.10/32',
'mgmt_addr': '10.7.0.196/26',
'type': 'ToRRouter'
},