Skip to content
Snippets Groups Projects
Commit 5f151be8 authored by Alex Wiens's avatar Alex Wiens
Browse files

Prule.daemon: Add http error exception

parent b6cdcb78
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ API_TAG_SCOPE Boolean, If true, uses scopes and adds default ' ...@@ -59,6 +59,7 @@ API_TAG_SCOPE Boolean, If true, uses scopes and adds default '
METADATA_MESSAGE HTML insert added to the metadata 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, JOB_PROCESS_QUIET Boolean, If true, pass --quiet to prule and do not print full result json,
if false print result json (default: true) if false print result json (default: true)
PRINT_TIMING Boolean, If true, print debug timing information
Example state file: Example state file:
{ {
...@@ -496,6 +497,8 @@ class PruleThread(threading.Thread): ...@@ -496,6 +497,8 @@ class PruleThread(threading.Thread):
if e.code == 401: if e.code == 401:
print("HTTP Error 401: Unauthorized, ClusterCockpit API TOKEN invalid?", file=sys.stderr) print("HTTP Error 401: Unauthorized, ClusterCockpit API TOKEN invalid?", file=sys.stderr)
signal.pthread_kill(config.main_tid, signal.SIGTERM) # shutdown 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 return False
except Exception as e: # something went horribly wrong except Exception as e: # something went horribly wrong
print(e) print(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment