mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix: #1066 - Catching parsing errors at linked vbox file
This commit is contained in:
1 parent
c1c3a9ed80
commit
5c0d955156
2 files changed
+18
-1
No files matched your search
@@ -209,7 +209,12 @@ class VirtualBoxVM(BaseNode):
|
||||
Fix the VM uuid in the case of linked clone
|
||||
"""
|
||||
if os.path.exists(self._linked_vbox_file()):
|
||||
tree = ET.parse(self._linked_vbox_file())
|
||||
try:
|
||||
tree = ET.parse(self._linked_vbox_file())
|
||||
except ET.ParseError:
|
||||
raise VirtualBoxError("Cannot modify VirtualBox linked nodes file. "
|
||||
"File {} is corrupted.".format(self._linked_vbox_file()))
|
||||
|
||||
machine = tree.getroot().find("{http://www.virtualbox.org/}Machine")
|
||||
if machine is not None and machine.get("uuid") != "{" + self.id + "}":
|
||||
|
||||
|
||||
Reference in new issue
Block a user