Commit 9b0fbc19 authored by Charlie Jacomme's avatar Charlie Jacomme

fix --force

parent 5bca432d
......@@ -18,10 +18,6 @@ api_hostname = config.get('Re2o', 'hostname')
api_password = config.get('Re2o', 'password')
api_username = config.get('Re2o', 'username')
for arg in sys.argv:
if arg=="--force":
api_client = Re2oAPIClient(api_hostname,api_username,api_password)
client_hostname = socket.gethostname().split('.',1)[0]
......@@ -65,13 +61,15 @@ def reconfigure(api_client):
error = True
print("error: {}".format(error))
input("passer au suivant ?")
return error
api_client.patch(service['home'], data={'need_regen': error}) # regen it if there is an error
for arg in sys.argv:
if arg=="--force":
for service in api_client.list("services/regen/"):
if service['hostname'] == client_hostname and \
service['service_name'] == 'dns' and \
api_client.patch(service['api_url'], data={'need_regen': False})
error = reconfigure(api_client)
api_client.patch(service['api_url'], data={'need_regen': error}) # Regen is there is an error
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment