summaryrefslogtreecommitdiffstats
path: root/ansible_collections/hetzner/hcloud/plugins/modules/rdns.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:18:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:18:41 +0000
commitb643c52cf29ce5bbab738b43290af3556efa1ca9 (patch)
tree21d5c53d7a9b696627a255777cefdf6f78968824 /ansible_collections/hetzner/hcloud/plugins/modules/rdns.py
parentReleasing progress-linux version 9.5.1+dfsg-1~progress7.99u1. (diff)
downloadansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.tar.xz
ansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.zip
Merging upstream version 10.0.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/hetzner/hcloud/plugins/modules/rdns.py')
-rw-r--r--ansible_collections/hetzner/hcloud/plugins/modules/rdns.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/ansible_collections/hetzner/hcloud/plugins/modules/rdns.py b/ansible_collections/hetzner/hcloud/plugins/modules/rdns.py
index b2decdec8..4e21f3e92 100644
--- a/ansible_collections/hetzner/hcloud/plugins/modules/rdns.py
+++ b/ansible_collections/hetzner/hcloud/plugins/modules/rdns.py
@@ -136,7 +136,6 @@ import ipaddress
from typing import Any
from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.common.text.converters import to_native
from ..module_utils.hcloud import AnsibleHCloud
from ..module_utils.vendor.hcloud import HCloudException
@@ -157,18 +156,18 @@ class AnsibleHCloudReverseDNS(AnsibleHCloud):
"server": None,
"floating_ip": None,
"load_balancer": None,
- "ip_address": to_native(self.hcloud_rdns["ip_address"]),
- "dns_ptr": to_native(self.hcloud_rdns["dns_ptr"]),
+ "ip_address": self.hcloud_rdns["ip_address"],
+ "dns_ptr": self.hcloud_rdns["dns_ptr"],
}
if self.module.params.get("server"):
- result["server"] = to_native(self.hcloud_resource.name)
+ result["server"] = self.hcloud_resource.name
elif self.module.params.get("floating_ip"):
- result["floating_ip"] = to_native(self.hcloud_resource.name)
+ result["floating_ip"] = self.hcloud_resource.name
elif self.module.params.get("load_balancer"):
- result["load_balancer"] = to_native(self.hcloud_resource.name)
+ result["load_balancer"] = self.hcloud_resource.name
elif self.module.params.get("primary_ip"):
- result["primary_ip"] = to_native(self.hcloud_resource.name)
+ result["primary_ip"] = self.hcloud_resource.name
return result
def _get_resource(self):
@@ -277,7 +276,8 @@ class AnsibleHCloudReverseDNS(AnsibleHCloud):
if not self.module.check_mode:
try:
- self.hcloud_resource.change_dns_ptr(**params).wait_until_finished()
+ action = self.hcloud_resource.change_dns_ptr(**params)
+ action.wait_until_finished()
except HCloudException as exception:
self.fail_json_hcloud(exception)
self._mark_as_changed()
@@ -294,7 +294,8 @@ class AnsibleHCloudReverseDNS(AnsibleHCloud):
if not self.module.check_mode:
try:
- self.hcloud_resource.change_dns_ptr(**params).wait_until_finished()
+ action = self.hcloud_resource.change_dns_ptr(**params)
+ action.wait_until_finished()
except HCloudException as exception:
self.fail_json_hcloud(exception)
self._mark_as_changed()