Skip to content

Commit eaaa571

Browse files
Add net-setup-method instead of userdata
1 parent 2092de7 commit eaaa571

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

extensions/MaaS/maas.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,16 @@ def create(self):
163163
fail("system_id missing for create")
164164

165165
ds = self.data.get("distro_series", "ubuntu/focal")
166-
vm_name = self.data.get("vm_name")
167-
168-
# Cloud-init userdata to disable netplan, flush IPs on ens35, and run dhclient
169-
userdata = """#cloud-config
170-
network:
171-
config: disabled
172-
runcmd:
173-
- [ sh, -c, "dhclient -v -4 ens35 || true" ]
174-
"""
175-
176166
self.call_maas(
177167
"POST",
178168
f"/machines/{sysid}/",
179169
{
180170
"op": "deploy",
181171
"distro_series": ds,
182-
"userdata": userdata,
172+
"net-setup-method": "curtin",
183173
},
184174
)
185-
succeed({"status": "success", "message": f"Instance created with {self.data['distro_series']}"})
175+
succeed({"status": "success", "message": f"Instance created with {ds}"})
186176

187177
def delete(self):
188178
sysid = self.data.get("system_id")

0 commit comments

Comments
 (0)