@@ -429,6 +429,13 @@ def spine_provision(self, rack, equips):
429
429
if spine_num == 1 :
430
430
# variablestochangespine1["DESCRIPTION1CONNECT"] = equips_sorted[0].get("nome")
431
431
# variablestochangespine1["DESCRIPTION2CONNECT"] = equips_sorted[1].get("nome")
432
+ for lf in equips_sorted [:2 ]:
433
+ interface_counter = 1
434
+ for iface in lf .get ("interfaces" ):
435
+ if iface .get ("nome" )[:3 ] == self .spine_prefix and iface .get ("nome" )[- 1 ] == 1 :
436
+ variablestochangespine1 ["SINGLE1{}INT" .format (interface_counter )] = iface .get ("interface" )
437
+ # variablestochangespine1["SINGLE2{}INT".format(interface_counter)] = iface.get("interface")
438
+ interface_counter += 1
432
439
433
440
variablestochangespine1 ["VLANBORDA2LEAF" ] = str (vlanBO [spine_num ])
434
441
variablestochangespine1 ["VLANBORDA2CACHOSLEAF" ] = str (vlanBOCA [spine_num ])
@@ -455,6 +462,13 @@ def spine_provision(self, rack, equips):
455
462
# variablestochangespine1["IPNEIGHLEAF2IPV4"] = str(IPLEAFipv4[numero_rack][spine_num])
456
463
# variablestochangespine1["IPNEIGHLEAF2IPV6"] = str(IPLEAFipv6[numero_rack][spine_num])
457
464
elif spine_num == 2 :
465
+ for lf in equips_sorted [:2 ]:
466
+ interface_counter = 1
467
+ for iface in lf .get ("interfaces" ):
468
+ if iface .get ("nome" )[:3 ] == self .spine_prefix and iface .get ("nome" )[- 1 ] == 2 :
469
+ variablestochangespine1 ["SINGLE2{}INT" .format (interface_counter )] = iface .get ("interface" )
470
+ # variablestochangespine1["SINGLE2{}INT".format(interface_counter)] = iface.get("interface")
471
+ interface_counter += 1
458
472
variablestochangespine1 ["VLANBORDA2LEAF" ] = str (vlanBO [spine_num - 2 ])
459
473
variablestochangespine1 ["VLANBORDA2CACHOSLEAF" ] = str (vlanBOCA [spine_num - 2 ])
460
474
variablestochangespine1 ["VLANBORDA2CACHOSB" ] = str (vlanBOCAB [spine_num - 2 ])
@@ -486,11 +500,7 @@ def spine_provision(self, rack, equips):
486
500
# # "DESCRIPTION{}CONNECT"
487
501
488
502
# e_counter += 1
489
- interface_counter = 1
490
- for iface in equip .get ("interfaces" ):
491
- variablestochangespine1 ["SINGLE1{}INT" .format (interface_counter )] = iface .get ("interface" )
492
- variablestochangespine1 ["SINGLE2{}INT" .format (interface_counter )] = iface .get ("interface" )
493
- interface_counter += 1
503
+
494
504
variablestochangespine1 ["DESCRIPTION1CONNECT" ] = equips_sorted [1 ].get ("nome" )
495
505
variablestochangespine1 ["DESCRIPTION2CONNECT" ] = equips_sorted [0 ].get ("nome" )
496
506
#### END to Berrini Block #####
0 commit comments