Skip to content

Commit

Permalink
chore: updates files
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola authored and renovate[bot] committed Jul 31, 2024
1 parent 4878555 commit 563e2bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 2 additions & 3 deletions plugins/module_utils/vendor/hcloud/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class Client:
_version = __version__
__user_agent_prefix = "hcloud-python"

_retry_interval = exponential_backoff_function(
base=1.0, multiplier=2, cap=60.0, jitter=True
_retry_interval = staticmethod(
exponential_backoff_function(base=1.0, multiplier=2, cap=60.0, jitter=True)
)
_retry_max_retries = 5

Expand Down Expand Up @@ -294,7 +294,6 @@ def request( # type: ignore[no-untyped-def]
error["code"] == "rate_limit_exceeded"
and retries < self._retry_max_retries
):
# pylint: disable=too-many-function-args
time.sleep(self._retry_interval(retries))
retries += 1
continue
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/vendor/hcloud/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "2.1.0" # x-release-please-version
__version__ = "2.1.1" # x-release-please-version
14 changes: 9 additions & 5 deletions plugins/module_utils/vendor/hcloud/actions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ def wait_until_finished(self, max_retries: int | None = None) -> None:
max_retries = self._client._client._poll_max_retries

retries = 0
while self.status == Action.STATUS_RUNNING:
while True:
self.reload()
if self.status != Action.STATUS_RUNNING:
break

retries += 1
if retries < max_retries:
self.reload()
retries += 1
# pylint: disable=protected-access
time.sleep(self._client._client._poll_interval_func(retries))
else:
raise ActionTimeoutException(action=self)
continue

raise ActionTimeoutException(action=self)

if self.status == Action.STATUS_ERROR:
raise ActionFailedException(action=self)
Expand Down

0 comments on commit 563e2bd

Please sign in to comment.