From 720adb7721acac32a13baea81d4db95cd582804d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 10 Jan 2017 14:22:04 +0100 Subject: [PATCH] Fix a crash with VirtualBox in some conditions Fix #863 --- gns3server/compute/virtualbox/virtualbox_vm.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index a56f7c11..92d7f50b 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -206,10 +206,11 @@ class VirtualBoxVM(BaseNode): """ Fix the VM uuid in the case of linked clone """ - tree = ET.parse(self._linked_vbox_file()) - machine = tree.getroot().find("{http://www.virtualbox.org/}Machine") - machine.set("uuid", "{" + self.id + "}") - tree.write(self._linked_vbox_file()) + if os.path.exists(self._linked_vbox_file()): + tree = ET.parse(self._linked_vbox_file()) + machine = tree.getroot().find("{http://www.virtualbox.org/}Machine") + machine.set("uuid", "{" + self.id + "}") + tree.write(self._linked_vbox_file()) @asyncio.coroutine def check_hw_virtualization(self):