Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
job-pattern-rule-evaluation-wip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PathoJobs
job-pattern-rule-evaluation-wip
Commits
5f151be8
Commit
5f151be8
authored
4 months ago
by
Alex Wiens
Browse files
Options
Downloads
Patches
Plain Diff
Prule.daemon: Add http error exception
parent
b6cdcb78
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
prule/daemon/__main__.py
+3
-0
3 additions, 0 deletions
prule/daemon/__main__.py
with
3 additions
and
0 deletions
prule/daemon/__main__.py
+
3
−
0
View file @
5f151be8
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment