Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hcloud_network_info failing with Servers without internet connectivity #159

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions plugins/modules/hcloud_network_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@
type: str
sample: cx11
ipv4_address:
description: Public IPv4 address of the server
description: Public IPv4 address of the server, None if not existing
returned: always
type: str
sample: 116.203.104.109
ipv6:
description: IPv6 network of the server
description: IPv6 network of the server, None if not existing
returned: always
type: str
sample: 2a01:4f8:1c1c:c140::/64
Expand Down Expand Up @@ -220,11 +220,13 @@ def _prepare_result(self):
servers = []
for server in network.servers:
image = None if server.image is None else to_native(server.image.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)
prepared_server = {
"id": to_native(server.id),
"name": to_native(server.name),
"ipv4_address": to_native(server.public_net.ipv4.ip),
"ipv6": to_native(server.public_net.ipv6.ip),
"ipv4_address": ipv4_address,
"ipv6": ipv6,
"image": image,
"server_type": to_native(server.server_type.name),
"datacenter": to_native(server.datacenter.name),
Expand Down