Skip to content

Commit 64dc7d3

Browse files
use only distro_series
1 parent 722c21c commit 64dc7d3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

extensions/MaaS/maas.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ def parse_json(self):
5252

5353
details = json_data.get("cloudstack.vm.details", {}).get("details", {})
5454

55-
distro_series = details.get("distro_series", None)
56-
os_name = details.get("os") # "ubuntu" or "centos"
57-
release = details.get("release") # "20.04", "22.04", "8", etc.
58-
architecture = details.get("architecture") # "amd64/ga-20.04", "amd64/generic", etc.
55+
os_name = details.get("os") or vm.get("os")
56+
architecture = details.get("architecture") or vm.get("architecture")
57+
distro_series = details.get("distro_series") or vm.get("distro_series")
5958

6059
if not endpoint or not apikey:
6160
fail("Missing MAAS endpoint or apikey")
@@ -83,7 +82,6 @@ def parse_json(self):
8382
"secret": secret,
8483
"distro_series": distro_series or "ubuntu/focal",
8584
"os": os_name,
86-
"release": release,
8785
"architecture": architecture,
8886
"system_id": system_id,
8987
"vm_name": vm_name,
@@ -165,16 +163,13 @@ def create(self):
165163

166164
ds = self.data.get("distro_series", None)
167165
os_name = self.data.get("os")
168-
release = self.data.get("release")
169166
arch = self.data.get("architecture")
170167

171168
deploy_payload = {"op": "deploy"}
172169

173-
if os_name or release or arch:
170+
if os_name or arch:
174171
if os_name:
175172
deploy_payload["os"] = os_name
176-
if release:
177-
deploy_payload["release"] = release
178173
if arch:
179174
deploy_payload["architecture"] = arch
180175
if ds:

0 commit comments

Comments
 (0)