Skip to content

Commit

Permalink
Merge pull request #395 from marcusgc/master
Browse files Browse the repository at this point in the history
Change code to generate the number of spines code dinamically
  • Loading branch information
renan-lopes-rodrigues authored Jul 9, 2024
2 parents 79d1ab4 + 165e5b8 commit 7a07fef
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions networkapi/api_rack/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,28 +282,17 @@ def spine_provision(self, rack, equips):
id_vlt = [envconfig.get("VLT").get("id_vlt_lf1"), envconfig.get("VLT").get("id_vlt_lf2")]
priority_vlt = [envconfig.get("VLT").get("priority_vlt_lf1"), envconfig.get("VLT").get("priority_vlt_lf2")]

IPSPINEipv4[numero_rack].append(CIDRBEipv4[0][0])
IPSPINEipv4[numero_rack].append(CIDRBEipv4[1][0])
IPSPINEipv4[numero_rack].append(CIDRBEipv4[2][0])
IPSPINEipv4[numero_rack].append(CIDRBEipv4[3][0])
#
IPLEAFipv4[numero_rack].append(CIDRBEipv4[0][1])
IPLEAFipv4[numero_rack].append(CIDRBEipv4[1][1])
IPLEAFipv4[numero_rack].append(CIDRBEipv4[2][1])
IPLEAFipv4[numero_rack].append(CIDRBEipv4[3][1])
for i in range(len(CIDRBEipv4)):
IPSPINEipv4[numero_rack].append(CIDRBEipv4[i][0])
IPLEAFipv4[numero_rack].append(CIDRBEipv4[i][1])

IPSPINEipv6[numero_rack].append(CIDRBEipv6[i][0])
IPLEAFipv6[numero_rack].append(CIDRBEipv6[i][1])

#
IPSIBGPipv4[numero_rack].append(IBGPToRLxLipv4[0])
IPSIBGPipv4[numero_rack].append(IBGPToRLxLipv4[1])
#
IPSPINEipv6[numero_rack].append(CIDRBEipv6[0][0])
IPSPINEipv6[numero_rack].append(CIDRBEipv6[1][0])
IPSPINEipv6[numero_rack].append(CIDRBEipv6[2][0])
IPSPINEipv6[numero_rack].append(CIDRBEipv6[3][0])
#
IPLEAFipv6[numero_rack].append(CIDRBEipv6[0][1])
IPLEAFipv6[numero_rack].append(CIDRBEipv6[1][1])
IPLEAFipv6[numero_rack].append(CIDRBEipv6[2][1])
IPLEAFipv6[numero_rack].append(CIDRBEipv6[3][1])
#
IPSIBGPipv6[numero_rack].append(IBGPToRLxLipv6[0])
IPSIBGPipv6[numero_rack].append(IBGPToRLxLipv6[1])
Expand All @@ -322,6 +311,10 @@ def spine_provision(self, rack, equips):
log.debug("as")
log.debug(BASE_AS_LFS)
log.debug(numero_rack)
log.debug(numero_rack)
log.debug("zip equips_sorted")
log.debug(zip(equips_sorted[:2], [0, 2], [0, 1]))

ASLEAF[numero_rack].append(BASE_AS_LFS + numero_rack)

for equip, spn, j in zip(equips_sorted[:2], [0, 2], [0, 1]):
Expand Down

0 comments on commit 7a07fef

Please sign in to comment.