From 908481ae2fb5a456a2f9e924b321bb0c0c5bb7a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 26 May 2023 17:10:52 +0200 Subject: [PATCH] Continued: - one character more to remove which cuts of the separator, e.g. '/' - also don't raise exceptions here, a returned unmodified software name is just fine --- fba.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fba.py b/fba.py index 14caf61..3ac23c3 100644 --- a/fba.py +++ b/fba.py @@ -103,7 +103,7 @@ def remove_version(software: str) -> str: # NOISY-DEBUG: print(f"DEBUG: software='{software}' - CALLED!") if not "." in software: print(f"WARNING: software='{software}' does not contain a version number.") - raise + return software version = None if " " in software: @@ -132,7 +132,7 @@ def remove_version(software: str) -> str: return software # NOISY-DEBUG: print(f"DEBUG: Found valid version number: '{version}', removing it ...") - end = len(software) - len(version) + end = len(software) - len(version) - 1 # NOISY-DEBUG: print(f"DEBUG: end[{type(end)}]={end}") software = software[0:end].strip() @@ -417,10 +417,10 @@ def post_json_api(domain: str, path: str, data: str) -> list: if not res.ok or res.status_code >= 400: print("WARNING: Cannot query JSON API:", domain, path, data, res.status_code) update_last_error(domain, res) - raise + else: + update_last_nodeinfo(domain) + json = res.json() - update_last_nodeinfo(domain) - json = res.json() except BaseException as e: print("WARNING: Some error during post():", domain, path, data, e) -- 2.39.5