Skip to content

Commit

Permalink
Merge 95a24a2 into 1502e8d
Browse files Browse the repository at this point in the history
  • Loading branch information
dichn committed Aug 31, 2021
2 parents 1502e8d + 95a24a2 commit cf57677
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ubipop/_pulp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

HTTP_TOTAL_RETRIES = int(os.environ.get("UBIPOP_HTTP_TOTAL_RETRIES", 10))
HTTP_RETRY_BACKOFF = float(os.environ.get("UBIPOP_HTTP_RETRY_BACKOFF", 1))
HTTP_TIMEOUT = int(os.environ.get("UBIPOP_HTTP_TIMEOUT", 60))


class UnsupportedTypeId(Exception):
Expand Down Expand Up @@ -77,9 +78,13 @@ def do_request(self, req_type, url, data=None):
req_url = urljoin(self.base_url, url)

if req_type == "post":
ret = self.local.session.post(req_url, json=data, verify=not self.insecure)
ret = self.local.session.post(
req_url, json=data, verify=not self.insecure, timeout=HTTP_TIMEOUT
)
elif req_type == "get":
ret = self.local.session.get(req_url, verify=not self.insecure)
ret = self.local.session.get(
req_url, verify=not self.insecure, timeout=HTTP_TIMEOUT
)
else:
ret = None

Expand Down

0 comments on commit cf57677

Please sign in to comment.