Disallow export of project with VirtualBox linked clone

Fix https://github.com/GNS3/gns3-gui/issues/1824
This commit is contained in:
Julien Duponchelle committed 2017-02-14 16:41:31 +01:00
1 parent a191029c4f
commit e04eb44a15
3 files changed
+24 -4

No files matched your search

+2
View File
@@ -136,6 +136,8 @@ def _export_project_file(project, path, z, include_images, keep_compute_id, allo
if "topology" in topology:
if "nodes" in topology["topology"]:
for node in topology["topology"]["nodes"]:
if node["node_type"] == "virtualbox" and node.get("properties", {}).get("linked_clone"):
raise aiohttp.web.HTTPConflict(text="Topology with a linked {} clone could not be exported. Use qemu instead.".format(node["node_type"]))
if not allow_all_nodes and node["node_type"] in ["virtualbox", "vmware", "cloud"]:
raise aiohttp.web.HTTPConflict(text="Topology with a {} could not be exported".format(node["node_type"]))