Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Add timeout to urllib3 get() as I think the "global default" is actua…
Browse files Browse the repository at this point in the history
…lly 0 in our case
  • Loading branch information
alex-thorley-numan committed Oct 10, 2023
1 parent 666fc14 commit 3e9457b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/fetch_vault_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def fetch_token(vault_address, role_namespace, role_id, role_secret):
"utf-8"
),
)
vault_token_opener = urllib.request.urlopen(req)
vault_token_opener = urllib.request.urlopen(req, timeout=10)
vault_token_response_headers = dict(vault_token_opener.getheaders())
vault_token_response_body = vault_token_opener.read()

Expand Down Expand Up @@ -145,7 +145,7 @@ def fetch_secret(
"X-Vault-Token": vault_token,
},
)
vault_secret_response = urllib.request.urlopen(req)
vault_secret_response = urllib.request.urlopen(req, timeout=10)
return json.loads(vault_secret_response.read().decode("utf-8"))["data"][
"data"
]
Expand Down

0 comments on commit 3e9457b

Please sign in to comment.