add debug nfo

This commit is contained in:
Antonio J. Delgado 2023-10-06 17:24:18 +03:00
parent f3e3bbdde7
commit 0e0450549e
3 changed files with 14 additions and 8 deletions

View file

@ -76,10 +76,17 @@ the hostname: {data}"""
f"""An A record ({record_exists}) exists for this f"""An A record ({record_exists}) exists for this
hostname, updating it.""" hostname, updating it."""
) )
uri = f"/domain/zone/{self.config['domain']}/record/{record_exists['id']}"
try:
result = self.ovh.put( result = self.ovh.put(
f"/domain/zone/{self.config['domain']}/record/{record_exists['id']}", uri,
**params, **params,
) )
except Exception as error:
self._log.error(
f"Error updating record with URI {uri}. {error}"
)
sys.exit(1)
else: else:
result = f"""A record exists {record_exists} with the same result = f"""A record exists {record_exists} with the same
target, doing nothing.""" target, doing nothing."""
@ -122,8 +129,7 @@ the hostname: {data}"""
hostname, updating it.""" hostname, updating it."""
) )
result = self.ovh.put( result = self.ovh.put(
f"""/domain/zone/{self.config['domain']}/ f"""/domain/zone/{self.config['domain']}/record/{record_exists['id']}""",
record/{record_exists['id']}""",
**params, **params,
) )
else: else:

View file

@ -7,7 +7,7 @@ Homepage = "https://susurrando.com"
[project] [project]
name = "odi6" name = "odi6"
version = "0.0.4" version = "0.0.5"
description = "Update Dynamic Host IPv6 in OVH" description = "Update Dynamic Host IPv6 in OVH"
readme = "README.md" readme = "README.md"
authors = [{ name = "Antonio J. Delgado", email = "antonio@susurrando.com" }] authors = [{ name = "Antonio J. Delgado", email = "antonio@susurrando.com" }]

View file

@ -1,6 +1,6 @@
[metadata] [metadata]
name = odi6 name = odi6
version = 0.0.4 version = 0.0.5
[options] [options]
packages = odi6 packages = odi6