From 1f0fe6d304f3703ae1269d7f3f0711189874e3a0 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 27 Jun 2016 12:38:18 +0200 Subject: [PATCH] Fix import of project with no disk Ref #590 --- gns3server/modules/project.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gns3server/modules/project.py b/gns3server/modules/project.py index f14b74df..28f626f7 100644 --- a/gns3server/modules/project.py +++ b/gns3server/modules/project.py @@ -647,7 +647,6 @@ class Project: "iou": "IOUDevice", "docker": "DockerVM" } - vm_directory = os.path.join(self.path, "servers", "vm", "project-files") vm_server_use = False @@ -657,11 +656,11 @@ class Project: os.makedirs(vm_directory, exist_ok=True) shutil.move(module_directory, os.path.join(vm_directory, module)) - # Patch node to use the GNS3 VM - for node in topology["topology"]["nodes"]: - if node["type"] == device_type: - node["server_id"] = 2 - vm_server_use = True + # Patch node to use the GNS3 VM + for node in topology["topology"]["nodes"]: + if node["type"] == device_type: + node["server_id"] = 2 + vm_server_use = True # We use the GNS3 VM. We need to add the server to the list if vm_server_use: