enable refresh

This commit is contained in:
Charlie Jacomme 2018-08-08 19:00:33 +02:00
parent 7b37ae5420
commit 4fcd0274bb

14
main.py
View file

@ -308,10 +308,10 @@ api_client = Re2oAPIClient(api_hostname, api_username, api_password)
client_hostname = socket.gethostname().split('.', 1)[0]
#for service in api_client.list("services/regen/"):
# if service['hostname'] == client_hostname and \
# service['service_name'] == 'dns' and \
# service['need_regen']:
write_dns_files(api_client)
write_dns_reverse_file(api_client)
# api_client.patch(service['api_url'], data={'need_regen': False})
for service in api_client.list("services/regen/"):
if service['hostname'] == client_hostname and \
service['service_name'] == 'dns' and \
service['need_regen']:
write_dns_files(api_client)
write_dns_reverse_file(api_client)
api_client.patch(service['api_url'], data={'need_regen': False})