Add try for updates
This commit is contained in:
parent
51b10c8293
commit
1a8dcfc0d9
1 changed files with 10 additions and 5 deletions
15
odi6/odi6.py
15
odi6/odi6.py
|
@ -44,11 +44,16 @@ class odi6:
|
|||
self._log.debug(
|
||||
f"IPv4: {ipv4}. IPv6: {ipv6}"
|
||||
)
|
||||
self._update_a_record(ipv4)
|
||||
if ipv6:
|
||||
self._update_aaaa_record(ipv6)
|
||||
result = self.ovh.post(f"/domain/zone/{self.config['domain']}/refresh")
|
||||
self._log.debug(f"Zone refresh result: {result}")
|
||||
try:
|
||||
self._update_a_record(ipv4)
|
||||
if ipv6:
|
||||
self._update_aaaa_record(ipv6)
|
||||
result = self.ovh.post(f"/domain/zone/{self.config['domain']}/refresh")
|
||||
self._log.debug(f"Zone refresh result: {result}")
|
||||
except Exception as error:
|
||||
self._log.error(
|
||||
"Error updating records. %s", error
|
||||
)
|
||||
|
||||
def _update_a_record(self, ipv4):
|
||||
a_records = self.ovh.get(
|
||||
|
|
Loading…
Reference in a new issue