Make distro_series param read from template or VM details

This commit is contained in:
Harikrishna Patnala 2025-09-11 16:36:26 +05:30
parent ea7807ebd1
commit 79002e7ff7
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ class MaasManager:
endpoint = host.get("endpoint") or extension.get("endpoint")
apikey = host.get("apikey") or extension.get("apikey")
distro_series = host.get("distro_series") or extension.get("distro_series") or "ubuntu"
distro_series = (
json_data.get("cloudstack.vm.details", {})
.get("details", {})
.get("distro_series", "ubuntu")
)
if not endpoint or not apikey:
fail("Missing MAAS endpoint or apikey")