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
Branches
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment