mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-11-10 06:34:13 +00:00
hcloud_server & hcloud_server_info fix backup window given out as "None" (#162)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de> Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
This commit is contained in:
parent
5cc7c58ecf
commit
78f0a0a519
3 changed files with 7 additions and 2 deletions
3
changelogs/fragments/hcloud_server_backup_window.yml
Normal file
3
changelogs/fragments/hcloud_server_backup_window.yml
Normal file
|
@ -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
|
|
@ -339,6 +339,7 @@ class AnsibleHcloudServer(Hcloud):
|
||||||
ipv4_address = None if self.hcloud_server.public_net.ipv4 is None else to_native(
|
ipv4_address = None if self.hcloud_server.public_net.ipv4 is None else to_native(
|
||||||
self.hcloud_server.public_net.ipv4.ip)
|
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)
|
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 {
|
return {
|
||||||
"id": to_native(self.hcloud_server.id),
|
"id": to_native(self.hcloud_server.id),
|
||||||
"name": to_native(self.hcloud_server.name),
|
"name": to_native(self.hcloud_server.name),
|
||||||
|
@ -350,7 +351,7 @@ class AnsibleHcloudServer(Hcloud):
|
||||||
"location": to_native(self.hcloud_server.datacenter.location.name),
|
"location": to_native(self.hcloud_server.datacenter.location.name),
|
||||||
"placement_group": placement_group,
|
"placement_group": placement_group,
|
||||||
"rescue_enabled": self.hcloud_server.rescue_enabled,
|
"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,
|
"labels": self.hcloud_server.labels,
|
||||||
"delete_protection": self.hcloud_server.protection["delete"],
|
"delete_protection": self.hcloud_server.protection["delete"],
|
||||||
"rebuild_protection": self.hcloud_server.protection["rebuild"],
|
"rebuild_protection": self.hcloud_server.protection["rebuild"],
|
||||||
|
|
|
@ -155,6 +155,7 @@ class AnsibleHcloudServerInfo(Hcloud):
|
||||||
placement_group = None if server.placement_group is None else to_native(server.placement_group.name)
|
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)
|
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)
|
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({
|
tmp.append({
|
||||||
"id": to_native(server.id),
|
"id": to_native(server.id),
|
||||||
"name": to_native(server.name),
|
"name": to_native(server.name),
|
||||||
|
@ -166,7 +167,7 @@ class AnsibleHcloudServerInfo(Hcloud):
|
||||||
"location": to_native(server.datacenter.location.name),
|
"location": to_native(server.datacenter.location.name),
|
||||||
"placement_group": placement_group,
|
"placement_group": placement_group,
|
||||||
"rescue_enabled": server.rescue_enabled,
|
"rescue_enabled": server.rescue_enabled,
|
||||||
"backup_window": to_native(server.backup_window),
|
"backup_window": backup_window,
|
||||||
"labels": server.labels,
|
"labels": server.labels,
|
||||||
"status": to_native(server.status),
|
"status": to_native(server.status),
|
||||||
"delete_protection": server.protection["delete"],
|
"delete_protection": server.protection["delete"],
|
||||||
|
|
Loading…
Reference in a new issue