Skip to content
Snippets Groups Projects
Commit 77321054 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

fix when missing boot_id file

parent 58926502
Branches
No related tags found
No related merge requests found
...@@ -693,7 +693,7 @@ def modify_net(ucred, vm: str, wan: bool = False, lan: bool = False, pc: bool = ...@@ -693,7 +693,7 @@ def modify_net(ucred, vm: str, wan: bool = False, lan: bool = False, pc: bool =
def start(ucred, vm: str): def start(ucred, vm: str):
vm = name_to_id(vm) vm = name_to_id(vm)
assert has_write_acces(ucred, 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) create_net(ucred, vm)
r("VBoxManage", "startvm", vm, "--type=headless") r("VBoxManage", "startvm", vm, "--type=headless")
if get_permanency(vm).startswith("init "): if get_permanency(vm).startswith("init "):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment