diff --git a/networkapi/api_rack/provision.py b/networkapi/api_rack/provision.py index 8d5e8c40..a0ef9b02 100644 --- a/networkapi/api_rack/provision.py +++ b/networkapi/api_rack/provision.py @@ -411,8 +411,12 @@ def spine_provision(self, rack, equips): variablestochangespine1["ASLEAF"] = str(ASLEAF[numero_rack][0]) ### TO BERRINI - variablestochangespine1["IPNEIGHLEAF2IPV4"] = str(IPLEAFipv4[numero_rack][spine_num]) - variablestochangespine1["IPNEIGHLEAF2IPV6"] = str(IPLEAFipv6[numero_rack][spine_num]) + if spine_num == 1: + variablestochangespine1["IPNEIGHLEAF2IPV4"] = str(IPLEAFipv4[numero_rack][spine_num]) + variablestochangespine1["IPNEIGHLEAF2IPV6"] = str(IPLEAFipv6[numero_rack][spine_num]) + elif spine_num == 2: + variablestochangespine1["IPNEIGHLEAF2IPV4"] = str(IPLEAFipv4[numero_rack][spine_num - 2]) + variablestochangespine1["IPNEIGHLEAF2IPV6"] = str(IPLEAFipv6[numero_rack][spine_num - 2]) variablestochangespine1["IPNEIGHLEAFIPV4"] = str(IPLEAFipv4[numero_rack][spine_num - 1]) variablestochangespine1["IPNEIGHLEAFIPV6"] = str(IPLEAFipv6[numero_rack][spine_num - 1])