Skip to content

Commit 5721dc1

Browse files
committed
vmrunner: apply image name do drives if no drives specified
1 parent c0b80b3 commit 5721dc1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

vmrunner/vmrunner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def boot(self, multiboot, kernel_args = "", image_name = None):
266266
else:
267267
kernel_args = []
268268
image_in_config = False
269+
269270
# If the provided image name is also defined in vm.json, use vm.json
270271
if "drives" in self._config:
271272
for disk in self._config["drives"]:
@@ -274,6 +275,8 @@ def boot(self, multiboot, kernel_args = "", image_name = None):
274275
if not image_in_config:
275276
info ("Provided image", image_name, "not found in config. Appending.")
276277
self._config["drives"].insert(0, {"file" : image_name, "type":"ide", "format":"raw", "media":"disk"})
278+
else:
279+
self._config["drives"] =[{"file" : image_name, "type":"ide", "format":"raw", "media":"disk"}]
277280

278281
info ("Booting", image_name, "with a bootable disk image")
279282

0 commit comments

Comments
 (0)