mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
If we don't have a GNS3 VM on linux don't move file to it
This commit is contained in:
4 files changed
+61
-5
No files matched your search
@@ -244,6 +244,12 @@ class Controller:
|
||||
raise aiohttp.web.HTTPNotFound(text="You try to use a node on the GNS3 VM server but the GNS3 is not configured")
|
||||
raise aiohttp.web.HTTPNotFound(text="Compute ID {} doesn't exist".format(compute_id))
|
||||
|
||||
def has_compute(self, compute_id):
|
||||
"""
|
||||
Return True if the compute exist in the controller
|
||||
"""
|
||||
return compute_id in self._computes
|
||||
|
||||
@asyncio.coroutine
|
||||
def add_project(self, project_id=None, name=None, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -74,8 +74,9 @@ def import_project(controller, project_id, stream, location=None, name=None, kee
|
||||
|
||||
# Modify the compute id of the node depending of compute capacity
|
||||
if not keep_compute_id:
|
||||
# For some VM type we move them to the GNS3 VM if it's not a Linux host
|
||||
if not sys.platform.startswith("linux"):
|
||||
# For some VM type we move them to the GNS3 VM if possible
|
||||
# unless it's a linux host without GNS3 VM
|
||||
if not sys.platform.startswith("linux") or controller.has_compute("vm"):
|
||||
for node in topology["topology"]["nodes"]:
|
||||
if node["node_type"] in ("docker", "qemu", "iou"):
|
||||
node["compute_id"] = "vm"
|
||||
|
||||
Reference in new issue
Block a user