From 77321054a2f8c52c443eb5e1ef66b015889d7495 Mon Sep 17 00:00:00 2001
From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Date: Mon, 25 Sep 2023 10:03:07 +0200
Subject: [PATCH] fix when missing boot_id file

---
 vm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vm.py b/vm.py
index 6e127bf..3100bd9 100755
--- a/vm.py
+++ b/vm.py
@@ -693,7 +693,7 @@ def modify_net(ucred, vm: str, wan: bool = False, lan: bool = False, pc: bool =
 def start(ucred, vm: str):
     vm = name_to_id(vm)
     assert has_write_acces(ucred, vm)
-    if open(vm_dir(vm)+"network/boot_id", "r").read().strip() != boot_id:
+    if not os.path.exists(vm_dir(vm)+"network/boot_id") or open(vm_dir(vm)+"network/boot_id", "r").read().strip() != boot_id:
         create_net(ucred, vm)
     r("VBoxManage", "startvm", vm, "--type=headless")
     if get_permanency(vm).startswith("init "):
-- 
GitLab