From 5f151be8a6a62e6b46634a8298a90fe928b4dfae Mon Sep 17 00:00:00 2001 From: Alex Wiens <alex.wiens@uni-paderborn.de> Date: Thu, 13 Feb 2025 17:19:59 +0100 Subject: [PATCH] Prule.daemon: Add http error exception --- prule/daemon/__main__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prule/daemon/__main__.py b/prule/daemon/__main__.py index 58d7765..1d08d7b 100644 --- a/prule/daemon/__main__.py +++ b/prule/daemon/__main__.py @@ -59,6 +59,7 @@ API_TAG_SCOPE Boolean, If true, uses scopes and adds default ' METADATA_MESSAGE HTML insert added to the metadata JOB_PROCESS_QUIET Boolean, If true, pass --quiet to prule and do not print full result json, if false print result json (default: true) +PRINT_TIMING Boolean, If true, print debug timing information Example state file: { @@ -496,6 +497,8 @@ class PruleThread(threading.Thread): if e.code == 401: print("HTTP Error 401: Unauthorized, ClusterCockpit API TOKEN invalid?", file=sys.stderr) signal.pthread_kill(config.main_tid, signal.SIGTERM) # shutdown + if e.code == 500 and "Duplicate entry" in msg: # TODO: Tag is inserted twice. Fix once tag removal is possible. + return True return False except Exception as e: # something went horribly wrong print(e) -- GitLab