Add timeout to requests connections to prevent uncontrolled consumption of socket descriptors

Change-Id: I273137f102371c246a80b491bc168542fe9e5029
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osmclient/sol005/osmrepo.py b/osmclient/sol005/osmrepo.py
index 48f69ef..69072a3 100644
--- a/osmclient/sol005/osmrepo.py
+++ b/osmclient/sol005/osmrepo.py
@@ -62,7 +62,7 @@
         vnf_repos = []
         for repository in repositories:
             try:
-                r = requests.get("{}/index.yaml".format(repository.get("url")))
+                r = requests.get(f"{repository.get('url')}/index.yaml", timeout=10)
 
                 if r.status_code == 200:
                     repo_list = yaml.safe_load(r.text)
@@ -133,6 +133,7 @@
                     r = requests.get(
                         "{}{}".format(pkg.get("repourl"), pkg.get("location")),
                         stream=True,
+                        timeout=10,  # Prevents uncontrolled consumption of socket descriptors
                     )
                     if r.status_code != 200:
                         raise ClientException("Package not found")