Skip to content

Commit

Permalink
- Fix #96
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Jun 16, 2021
1 parent 46ef6a2 commit ec881ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/python/src/ddns/gcloud_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ def sync_ip(self, dns_entries: Sequence[DNSEntry], zone_name: str, dns_name: str
[changes.add_record_set(
ResourceRecordSet(self.to_dns(dns, dns_name), 'A', dns.ttl, [dns.vpn_ip], zone)) for dns in
dns_entries if dns.is_valid()]
logger.info(f'Purge {len(changes.deletions)} DNS records then create {len(changes.additions)} DNS records')
if len(changes.additions) == 0 and len(changes.deletions) == 0:
logger.info(f'Nothing changes in zone[{zone_name}]')
return
logger.info(f'Purge {len(changes.deletions)} DNS records then create {len(changes.additions)} DNS records ' +
f'in zone[{zone_name}]')
changes.create(self.client)
loop_interval(lambda: changes.status != 'pending', 'Unable sync DNS', pre_func=lambda: changes.reload(),
max_retries=self.max_retries, interval=self.interval, exit_if_error=True)
Expand Down

0 comments on commit ec881ee

Please sign in to comment.