From: Roland Häder Date: Fri, 26 May 2023 15:10:52 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=908481ae2fb5a456a2f9e924b321bb0c0c5bb7a2;p=fba.git 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 --- 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)