diff --git a/hcloud/actions/client.py b/hcloud/actions/client.py index 85fc007..a3d6b03 100644 --- a/hcloud/actions/client.py +++ b/hcloud/actions/client.py @@ -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)