# Création du template final avec les valeurs contenues dans le dictionnaire "valeurs" - Ces valeurs sont positionnées dans un objet "temp", qui sera utilisé par le moteur, et que l'on retrouve dans le template.
forarginsys.argv:
ifarg=="--force":
sw=Switch()
forswitchinall_switchs:
sw.switch=switch
sw.gen_conf_and_write()
try:
sw.apply_conf()
except:
print("Erreur dans l'application de la conf pour "+switch["short_name"])
classSwitch:
def__init__(self):
@ -170,6 +184,11 @@ class Switch:
forserviceinapi_client.list("services/regen/"):
ifservice['hostname']==client_hostnameand \
service['service_name']=='switchs'and \
service['need_regen']:
error=False
sw=Switch()
forswitchinall_switchs:
sw.switch=switch
@ -177,4 +196,5 @@ for switch in all_switchs:
try:
sw.apply_conf()
except:
print("Erreur dans l'application de la conf pour "+switch["short_name"])