Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LSO
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
LSO
Commits
0ccdca31
Verified
Commit
0ccdca31
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
move api timeout to a static variable in config.py
parent
7a652eda
No related branches found
No related tags found
1 merge request
!51
Feature/update callback
Pipeline
#84369
passed
1 year ago
Stage: tox
Stage: documentation
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lso/config.py
+1
-0
1 addition, 0 deletions
lso/config.py
lso/playbook.py
+3
-1
3 additions, 1 deletion
lso/playbook.py
with
4 additions
and
1 deletion
lso/config.py
+
1
−
0
View file @
0ccdca31
...
@@ -19,6 +19,7 @@ CONFIG_SCHEMA = {
...
@@ -19,6 +19,7 @@ CONFIG_SCHEMA = {
"
required
"
:
[
"
ansible_playbooks_root_dir
"
],
"
required
"
:
[
"
ansible_playbooks_root_dir
"
],
"
additionalProperties
"
:
False
,
"
additionalProperties
"
:
False
,
}
}
DEFAULT_REQUEST_TIMEOUT
=
10
class
Config
(
BaseModel
):
class
Config
(
BaseModel
):
...
...
This diff is collapsed.
Click to expand it.
lso/playbook.py
+
3
−
1
View file @
0ccdca31
...
@@ -12,6 +12,8 @@ import xmltodict
...
@@ -12,6 +12,8 @@ import xmltodict
from
dictdiffer
import
diff
from
dictdiffer
import
diff
from
pydantic
import
BaseModel
,
HttpUrl
from
pydantic
import
BaseModel
,
HttpUrl
from
lso.config
import
DEFAULT_REQUEST_TIMEOUT
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -153,7 +155,7 @@ def _run_playbook_proc(job_id: str, playbook_path: str, extra_vars: dict, invent
...
@@ -153,7 +155,7 @@ def _run_playbook_proc(job_id: str, playbook_path: str, extra_vars: dict, invent
"
return_code
"
:
int
(
ansible_playbook_run
.
rc
),
"
return_code
"
:
int
(
ansible_playbook_run
.
rc
),
}
}
request_result
=
requests
.
post
(
callback
,
json
=
payload
,
timeout
=
10000
)
request_result
=
requests
.
post
(
callback
,
json
=
payload
,
timeout
=
DEFAULT_REQUEST_TIMEOUT
)
assert
request_result
.
status_code
==
200
assert
request_result
.
status_code
==
200
...
...
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