bugfix
This commit is contained in:
parent
8e70bc5ece
commit
d321aeb2ea
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -58,7 +58,7 @@ template_reverse = ("$TTL 2D\n"
|
|||
"{ptr_records}\n")
|
||||
|
||||
def write_dns_files(api_client):
|
||||
for zone in api_client.list_dnszones():
|
||||
for zone in api_client.view("dns/zones")['results']:
|
||||
zone_name = zone['name'][1:]
|
||||
|
||||
now = datetime.datetime.now(datetime.timezone.utc)
|
||||
|
@ -154,10 +154,10 @@ api_client = Re2oAPIClient(api_hostname, api_username, api_password)
|
|||
|
||||
client_hostname = socket.gethostname().split('.', 1)[0]
|
||||
|
||||
for service in api_client.view("services/regen/"):
|
||||
for service in api_client.view("services/regen/")['results']:
|
||||
# if service['hostname'] == client_hostname and \
|
||||
# service['service_name'] == 'dns' and \
|
||||
# service['need_regen']:
|
||||
write_dns_zone_file(api_client)
|
||||
write_dns_files(api_client)
|
||||
write_dns_reverse_file(api_client)
|
||||
# api_client.patch(service['api_url'], data={'need_regen': False})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue