|
|
@ -21,7 +21,6 @@ api_client = Re2oAPIClient(api_hostname, api_username, api_password)
|
|
|
|
|
|
|
|
|
|
|
|
client_hostname = socket.gethostname().split('.', 1)[0]
|
|
|
|
client_hostname = socket.gethostname().split('.', 1)[0]
|
|
|
|
|
|
|
|
|
|
|
|
print("get switchs conf")
|
|
|
|
|
|
|
|
all_switchs = api_client.list("switchs/ports-config/")
|
|
|
|
all_switchs = api_client.list("switchs/ports-config/")
|
|
|
|
|
|
|
|
|
|
|
|
# Création de l'environnement Jinja
|
|
|
|
# Création de l'environnement Jinja
|
|
|
@ -146,14 +145,13 @@ class Switch:
|
|
|
|
with open("generated/" + self.get_conf_file_name(), 'w+') as f:
|
|
|
|
with open("generated/" + self.get_conf_file_name(), 'w+') as f:
|
|
|
|
f.write(self.conf)
|
|
|
|
f.write(self.conf)
|
|
|
|
|
|
|
|
|
|
|
|
print("gen tpl")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sw = Switch()
|
|
|
|
sw = Switch()
|
|
|
|
for switch in all_switchs:
|
|
|
|
for switch in all_switchs:
|
|
|
|
sw.switch = switch
|
|
|
|
sw.switch = switch
|
|
|
|
sw.gen_conf_and_write()
|
|
|
|
sw.gen_conf_and_write()
|
|
|
|
sw.apply_conf()
|
|
|
|
try:
|
|
|
|
# sw.gen_conf_hp()
|
|
|
|
sw.apply_conf()
|
|
|
|
# sw.write_conf()
|
|
|
|
except:
|
|
|
|
|
|
|
|
print("Erreur dans l'application de la conf pour " + switch["short_name"])
|
|
|
|