1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

fix: improve actions waiting timeout based on data (#488)

##### SUMMARY

Some action waiting time have been set to an arbitrary number, which
could force the users to wait for too long, while we could have raised a
timeout.

This changes the arbitrary numbers with rough estimate based on the
average actions time and some leeway.
This commit is contained in:
Jonas L 2024-04-15 11:01:12 +02:00 committed by GitHub
parent 04835d543f
commit 07095529a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 113 additions and 69 deletions

View file

@ -129,7 +129,8 @@ class AnsibleHCloudRoute(AnsibleHCloud):
if not self.module.check_mode:
try:
self.hcloud_network.add_route(route=route).wait_until_finished()
action = self.hcloud_network.add_route(route=route)
action.wait_until_finished()
except HCloudException as exception:
self.fail_json_hcloud(exception)
@ -149,7 +150,8 @@ class AnsibleHCloudRoute(AnsibleHCloud):
if self.hcloud_route is not None and self.hcloud_network is not None:
if not self.module.check_mode:
try:
self.hcloud_network.delete_route(self.hcloud_route).wait_until_finished()
action = self.hcloud_network.delete_route(self.hcloud_route)
action.wait_until_finished()
except HCloudException as exception:
self.fail_json_hcloud(exception)
self._mark_as_changed()