Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
e0b10aa5
Commit
e0b10aa5
authored
1 year ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Don't validate joblog:cached-response values
parent
557da151
No related branches found
No related tags found
1 merge request
!20
Don't validate joblog:cached-response values
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/routes/jobs.py
+5
-6
5 additions, 6 deletions
inventory_provider/routes/jobs.py
inventory_provider/tasks/monitor.py
+6
-2
6 additions, 2 deletions
inventory_provider/tasks/monitor.py
with
11 additions
and
8 deletions
inventory_provider/routes/jobs.py
+
5
−
6
View file @
e0b10aa5
...
@@ -53,10 +53,10 @@ TASK_LOG_RESPONSE_SCHEMA = {
...
@@ -53,10 +53,10 @@ TASK_LOG_RESPONSE_SCHEMA = {
"
$schema
"
:
"
https://json-schema.org/draft-07/schema#
"
,
"
$schema
"
:
"
https://json-schema.org/draft-07/schema#
"
,
"
type
"
:
"
object
"
,
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
properties
"
:
{
"
pending
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
pending
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
errors
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
errors
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
failed
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
failed
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
warnings
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
"
warnings
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}},
},
},
"
required
"
:
[
"
pending
"
,
"
errors
"
,
"
failed
"
,
"
warnings
"
],
"
required
"
:
[
"
pending
"
,
"
errors
"
,
"
failed
"
,
"
warnings
"
],
"
additionalProperties
"
:
False
"
additionalProperties
"
:
False
...
@@ -198,8 +198,7 @@ def load_task_log():
...
@@ -198,8 +198,7 @@ def load_task_log():
}
}
found_tasks
=
False
found_tasks
=
False
for
task
in
monitor
.
load_task_log
(
for
task
in
monitor
.
load_task_log
(
current_app
.
config
[
'
INVENTORY_PROVIDER_CONFIG
'
],
{
cache_key
}).
values
():
current_app
.
config
[
'
INVENTORY_PROVIDER_CONFIG
'
]).
values
():
found_tasks
=
True
found_tasks
=
True
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/tasks/monitor.py
+
6
−
2
View file @
e0b10aa5
...
@@ -102,7 +102,7 @@ def run():
...
@@ -102,7 +102,7 @@ def run():
with
app
.
connection
()
as
connection
:
with
app
.
connection
()
as
connection
:
recv
=
app
.
events
.
Receiver
(
connection
,
handlers
=
{
recv
=
app
.
events
.
Receiver
(
connection
,
handlers
=
{
'
*
'
:
_log_event
'
*
'
:
_log_event
})
})
recv
.
capture
(
limit
=
None
,
timeout
=
None
,
wakeup
=
True
)
recv
.
capture
(
limit
=
None
,
timeout
=
None
,
wakeup
=
True
)
...
@@ -163,7 +163,7 @@ def _redis_client_proc(key_queue, value_queue, config_params):
...
@@ -163,7 +163,7 @@ def _redis_client_proc(key_queue, value_queue, config_params):
value_queue
.
put
(
None
)
value_queue
.
put
(
None
)
def
load_task_log
(
config_params
,
ignored_keys
=
[]
):
def
load_task_log
(
config_params
,
ignored_keys
=
None
):
"""
"""
load the task log in a formatted dictionary:
load the task log in a formatted dictionary:
keys are task uuid
'
s
keys are task uuid
'
s
...
@@ -178,6 +178,10 @@ def load_task_log(config_params, ignored_keys=[]):
...
@@ -178,6 +178,10 @@ def load_task_log(config_params, ignored_keys=[]):
:param ignored_keys: list of keys to ignore if found
:param ignored_keys: list of keys to ignore if found
:return:
:return:
"""
"""
if
ignored_keys
is
None
:
ignored_keys
=
set
()
response_queue
=
queue
.
Queue
()
response_queue
=
queue
.
Queue
()
threads
=
[]
threads
=
[]
...
...
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