diff --git a/changelogs/fragments/hcloud_server_backup_window.yml b/changelogs/fragments/hcloud_server_backup_window.yml new file mode 100644 index 0000000..5c129ce --- /dev/null +++ b/changelogs/fragments/hcloud_server_backup_window.yml @@ -0,0 +1,3 @@ +bugfixes: + - hcloud_server - fix backup window was given out as "None" instead of null + - hcloud_server_info - fix backup window was given out as "None" instead of null diff --git a/plugins/modules/hcloud_server.py b/plugins/modules/hcloud_server.py index d606380..521f2f4 100644 --- a/plugins/modules/hcloud_server.py +++ b/plugins/modules/hcloud_server.py @@ -339,6 +339,7 @@ class AnsibleHcloudServer(Hcloud): ipv4_address = None if self.hcloud_server.public_net.ipv4 is None else to_native( self.hcloud_server.public_net.ipv4.ip) ipv6 = None if self.hcloud_server.public_net.ipv6 is None else to_native(self.hcloud_server.public_net.ipv6.ip) + backup_window = None if self.hcloud_server.backup_window is None else to_native(self.hcloud_server.backup_window) return { "id": to_native(self.hcloud_server.id), "name": to_native(self.hcloud_server.name), @@ -350,7 +351,7 @@ class AnsibleHcloudServer(Hcloud): "location": to_native(self.hcloud_server.datacenter.location.name), "placement_group": placement_group, "rescue_enabled": self.hcloud_server.rescue_enabled, - "backup_window": to_native(self.hcloud_server.backup_window), + "backup_window": backup_window, "labels": self.hcloud_server.labels, "delete_protection": self.hcloud_server.protection["delete"], "rebuild_protection": self.hcloud_server.protection["rebuild"], diff --git a/plugins/modules/hcloud_server_info.py b/plugins/modules/hcloud_server_info.py index e656d35..6242b45 100644 --- a/plugins/modules/hcloud_server_info.py +++ b/plugins/modules/hcloud_server_info.py @@ -155,6 +155,7 @@ class AnsibleHcloudServerInfo(Hcloud): placement_group = None if server.placement_group is None else to_native(server.placement_group.name) ipv4_address = None if server.public_net.ipv4 is None else to_native(server.public_net.ipv4.ip) ipv6 = None if server.public_net.ipv6 is None else to_native(server.public_net.ipv6.ip) + backup_window = None if server.backup_window is None else to_native(server.backup_window) tmp.append({ "id": to_native(server.id), "name": to_native(server.name), @@ -166,7 +167,7 @@ class AnsibleHcloudServerInfo(Hcloud): "location": to_native(server.datacenter.location.name), "placement_group": placement_group, "rescue_enabled": server.rescue_enabled, - "backup_window": to_native(server.backup_window), + "backup_window": backup_window, "labels": server.labels, "status": to_native(server.status), "delete_protection": server.protection["delete"],