diff --git a/plugins/inventory/hcloud.py b/plugins/inventory/hcloud.py index f8ee043..c837728 100644 --- a/plugins/inventory/hcloud.py +++ b/plugins/inventory/hcloud.py @@ -169,16 +169,16 @@ if sys.version_info >= (3, 11): id: int name: str status: str + + # Server Type type: str + server_type: str architecture: str # Datacenter datacenter: str location: str - # Server Type - server_type: NotRequired[str] - # Labels labels: dict[str, str] @@ -306,7 +306,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): server_dict["id"] = server.id server_dict["name"] = to_native(server.name) server_dict["status"] = to_native(server.status) + + # Server Type server_dict["type"] = to_native(server.server_type.name) + server_dict["server_type"] = to_native(server.server_type.name) server_dict["architecture"] = to_native(server.server_type.architecture) # Network @@ -329,10 +332,6 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): server_dict["private_ipv4"] = to_native(private_net.ip) break - # Server Type - if server.server_type is not None: - server_dict["server_type"] = to_native(server.server_type.name) - # Datacenter server_dict["datacenter"] = to_native(server.datacenter.name) server_dict["location"] = to_native(server.datacenter.location.name)