@@ -89,11 +89,15 @@ def spines_environment_save(self):
8989 id_amb_log = amb_log_dict .id
9090 pass
9191 config = list ()
92+ subnet_index = (spn * int (self .rack .dcroom .racks ))+ int (self .rack .numero )
9293 for sub in config_subnet :
9394 config_spn = {
94- 'subnet' : str (sub .get ("cidr" )[spn ]),
95+ 'subnet' : str (sub .get ("cidr" )[subnet_index ]),
96+ 'network' : str (sub .get ("cidr" )[subnet_index ]),
9597 'new_prefix' : str (31 ) if str (sub .get ("type" ))[- 1 ] is "4" else str (127 ),
98+ 'subnet_mask' : str (31 ) if str (sub .get ("type" ))[- 1 ] is "4" else str (127 ),
9699 'type' : str (sub .get ("type" )),
100+ 'ip_version' : str (sub .get ("type" )),
97101 'network_type' : sub .get ("network_type" )
98102 }
99103 config .append (config_spn )
@@ -105,17 +109,18 @@ def spines_environment_save(self):
105109 'ipv4_template' : env .ipv4_template ,
106110 'ipv6_template' : env .ipv6_template ,
107111 'link' : env .link ,
108- 'min_num_vlan_2' : env .min_num_vlan_2 ,
109- 'max_num_vlan_2' : env .max_num_vlan_2 ,
110- 'min_num_vlan_1' : env .min_num_vlan_1 ,
111- 'max_num_vlan_1' : env .max_num_vlan_1 ,
112+ 'min_num_vlan_2' : env .min_num_vlan_1 + subnet_index ,
113+ 'max_num_vlan_2' : env .min_num_vlan_1 + subnet_index ,
114+ 'min_num_vlan_1' : env .min_num_vlan_1 + subnet_index ,
115+ 'max_num_vlan_1' : env .min_num_vlan_1 + subnet_index ,
112116 'vrf' : env .vrf ,
113117 'father_environment' : env .id ,
114118 'default_vrf' : env .default_vrf .id ,
115119 'configs' : config ,
116120 'fabric_id' : self .rack .dcroom .id
117121 }
118-
122+ environment = facade_env .create_environment (obj )
123+
119124 return environment_spn_lf_list
120125
121126 def spines_environment_read (self ):
@@ -178,7 +183,7 @@ def leaf_leaf_vlans_save(self):
178183 log .debug ("_create_lflf_vlans" )
179184
180185 env_lf = models_env .Ambiente .objects .filter (dcroom = int (self .rack .dcroom .id ),
181- grupo_l3__nome = str (self .rack .dcroom . name ),
186+ grupo_l3__nome = str (self .rack .name ),
182187 ambiente_logico__nome = "LEAF-LEAF" )
183188 log .debug ("Leaf-leaf environments: " + str (env_lf ))
184189
0 commit comments