Skip to content

Commit

Permalink
show retries in request error msg (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo committed Feb 13, 2024
1 parent d1c6106 commit fdb473e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/module_utils/vultr_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def api_query(self, path, method="GET", data=None, query_params=None):
# Vultr has a rate limiting requests per second, try to be polite
# Use exponential backoff plus a little bit of randomness
backoff(retry=retry, retry_max_delay=retry_max_delay)
else:
self.module.fail_json(
msg='Failure while calling the Vultr API v2 with %s for "%s" with %s retries' % (method, path, retry + 1),
fetch_url_info=info,
)

# Success with content
if info["status"] in (200, 201, 202):
Expand Down

0 comments on commit fdb473e

Please sign in to comment.