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

@ -216,7 +216,8 @@ class AnsibleHCloudFloatingIP(AnsibleHCloud):
delete_protection = self.module.params.get("delete_protection")
if delete_protection is not None:
self.hcloud_floating_ip.change_protection(delete=delete_protection).wait_until_finished()
action = self.hcloud_floating_ip.change_protection(delete=delete_protection)
action.wait_until_finished()
except HCloudException as exception:
self.fail_json_hcloud(exception)
self._mark_as_changed()
@ -261,7 +262,8 @@ class AnsibleHCloudFloatingIP(AnsibleHCloud):
delete_protection = self.module.params.get("delete_protection")
if delete_protection is not None and delete_protection != self.hcloud_floating_ip.protection["delete"]:
if not self.module.check_mode:
self.hcloud_floating_ip.change_protection(delete=delete_protection).wait_until_finished()
action = self.hcloud_floating_ip.change_protection(delete=delete_protection)
action.wait_until_finished()
self._mark_as_changed()
self._get_floating_ip()