Skip to content
Snippets Groups Projects
Commit f0d29907 authored by Baptiste DE RENZO's avatar Baptiste DE RENZO
Browse files

Add timeout on APT http requests

parent d934d511
No related branches found
No related tags found
No related merge requests found
...@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment