Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
f0d29907
Commit
f0d29907
authored
4 years ago
by
Baptiste DE RENZO
Browse files
Options
Downloads
Patches
Plain Diff
Add timeout on APT http requests
parent
d934d511
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/scripts/test_apt.py
+2
-2
2 additions, 2 deletions
tests/scripts/test_apt.py
with
2 additions
and
2 deletions
tests/scripts/test_apt.py
+
2
−
2
View file @
f0d29907
...
@@ -144,7 +144,7 @@ def main():
...
@@ -144,7 +144,7 @@ def main():
# check server avalability
# check server avalability
if
url
:
if
url
:
server_response
=
requests
.
get
(
url
,
verify
=
False
)
server_response
=
requests
.
get
(
url
,
verify
=
False
,
timeout
=
60
)
if
server_response
.
ok
:
if
server_response
.
ok
:
lg
.
success
(
"
request to {} succeeded
"
.
format
(
url
))
lg
.
success
(
"
request to {} succeeded
"
.
format
(
url
))
else
:
else
:
...
@@ -154,7 +154,7 @@ def main():
...
@@ -154,7 +154,7 @@ def main():
# check repository avalability
# check repository avalability
if
url
and
apt_token
:
if
url
and
apt_token
:
apt_url
=
"
{}/packaging/apt/{}/Packages
"
.
format
(
url
,
apt_token
)
apt_url
=
"
{}/packaging/apt/{}/Packages
"
.
format
(
url
,
apt_token
)
repo_response
=
requests
.
get
(
apt_url
,
verify
=
False
)
repo_response
=
requests
.
get
(
apt_url
,
verify
=
False
,
timeout
=
60
)
apt_url
=
"
{}/packaging/apt/{}[...]/Packages
"
.
format
(
url
,
apt_token
[:
8
])
apt_url
=
"
{}/packaging/apt/{}[...]/Packages
"
.
format
(
url
,
apt_token
[:
8
])
if
repo_response
.
ok
:
if
repo_response
.
ok
:
lg
.
success
(
"
request to {} succeeded
"
.
format
(
apt_url
))
lg
.
success
(
"
request to {} succeeded
"
.
format
(
apt_url
))
...
...
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