From 0e0450549e2128c0bdacf02f54bd4817d648e21f Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 6 Oct 2023 17:24:18 +0300 Subject: [PATCH] add debug nfo --- odi6/odi6.py | 18 ++++++++++++------ pyproject.toml | 2 +- setup.cfg | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/odi6/odi6.py b/odi6/odi6.py index f6481f2..96e2fa3 100755 --- a/odi6/odi6.py +++ b/odi6/odi6.py @@ -76,10 +76,17 @@ the hostname: {data}""" f"""An A record ({record_exists}) exists for this hostname, updating it.""" ) - result = self.ovh.put( - f"/domain/zone/{self.config['domain']}/record/{record_exists['id']}", - **params, - ) + uri = f"/domain/zone/{self.config['domain']}/record/{record_exists['id']}" + try: + result = self.ovh.put( + uri, + **params, + ) + except Exception as error: + self._log.error( + f"Error updating record with URI {uri}. {error}" + ) + sys.exit(1) else: result = f"""A record exists {record_exists} with the same target, doing nothing.""" @@ -122,8 +129,7 @@ the hostname: {data}""" hostname, updating it.""" ) result = self.ovh.put( - f"""/domain/zone/{self.config['domain']}/ -record/{record_exists['id']}""", + f"""/domain/zone/{self.config['domain']}/record/{record_exists['id']}""", **params, ) else: diff --git a/pyproject.toml b/pyproject.toml index 6bbb733..d899f5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ Homepage = "https://susurrando.com" [project] name = "odi6" -version = "0.0.4" +version = "0.0.5" description = "Update Dynamic Host IPv6 in OVH" readme = "README.md" authors = [{ name = "Antonio J. Delgado", email = "antonio@susurrando.com" }] diff --git a/setup.cfg b/setup.cfg index 81b0e3a..f21b342 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = odi6 -version = 0.0.4 +version = 0.0.5 [options] packages = odi6