mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch '2.0' into 2.1
This commit is contained in:
19 files changed
+218
-21
No files matched your search
@@ -580,8 +580,10 @@ class Compute:
|
||||
Forward a call to the emulator on compute
|
||||
"""
|
||||
try:
|
||||
res = yield from self.http_query(method, "/{}/{}".format(type, path), data=data, timeout=None)
|
||||
action = "/{}/{}".format(type, path)
|
||||
res = yield from self.http_query(method, action, data=data, timeout=None)
|
||||
except aiohttp.ServerDisconnectedError:
|
||||
log.error("Connection lost to %s during %s %s", self._id, method, action)
|
||||
raise aiohttp.web.HTTPGatewayTimeout()
|
||||
return res.json
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ class GNS3VM:
|
||||
force=True)
|
||||
except aiohttp.web.HTTPConflict:
|
||||
pass
|
||||
log.error("Can't start the GNS3 VM: {}", str(e))
|
||||
log.error("Can't start the GNS3 VM: %s", str(e))
|
||||
|
||||
@asyncio.coroutine
|
||||
def exit_vm(self):
|
||||
@@ -287,7 +287,7 @@ class GNS3VM:
|
||||
yield from engine.start()
|
||||
except Exception as e:
|
||||
yield from self._controller.delete_compute("vm")
|
||||
log.error("Can't start the GNS3 VM: {}", str(e))
|
||||
log.error("Can't start the GNS3 VM: {}".format(str(e)))
|
||||
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname))
|
||||
raise e
|
||||
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname),
|
||||
|
||||
@@ -24,7 +24,6 @@ import asyncio
|
||||
import zipfile
|
||||
import aiohttp
|
||||
|
||||
from ..config import Config
|
||||
from .topology import load_topology
|
||||
|
||||
|
||||
@@ -74,7 +73,7 @@ def import_project(controller, project_id, stream, location=None, name=None, kee
|
||||
path = location
|
||||
else:
|
||||
projects_path = controller.projects_directory()
|
||||
path = os.path.join(projects_path, project_name)
|
||||
path = os.path.join(projects_path, project_id)
|
||||
try:
|
||||
os.makedirs(path, exist_ok=True)
|
||||
except UnicodeEncodeError as e:
|
||||
|
||||
@@ -699,7 +699,10 @@ class Project:
|
||||
self._loading = False
|
||||
# Should we start the nodes when project is open
|
||||
if self._auto_start:
|
||||
yield from self.start_all()
|
||||
# Start all in the background without waiting for completion
|
||||
# we ignore errors because we want to let the user open
|
||||
# their project and fix it
|
||||
asyncio.async(self.start_all())
|
||||
|
||||
@asyncio.coroutine
|
||||
def wait_loaded(self):
|
||||
|
||||
@@ -321,6 +321,10 @@ def _convert_1_3_later(topo, topo_path):
|
||||
|
||||
node["properties"] = {}
|
||||
|
||||
# Some old dynamips node don't have type
|
||||
if "type" not in old_node:
|
||||
old_node["type"] = old_node["properties"]["platform"].upper()
|
||||
|
||||
if old_node["type"] == "VPCSDevice":
|
||||
node["node_type"] = "vpcs"
|
||||
elif old_node["type"] == "QemuVM":
|
||||
@@ -348,7 +352,7 @@ def _convert_1_3_later(topo, topo_path):
|
||||
node["symbol"] = ":/symbols/ethernet_switch.svg"
|
||||
node["console_type"] = None
|
||||
node["properties"]["ports_mapping"] = []
|
||||
for port in old_node["ports"]:
|
||||
for port in old_node.get("ports", []):
|
||||
node["properties"]["ports_mapping"].append({
|
||||
"name": "Ethernet{}".format(port["port_number"] - 1),
|
||||
"port_number": port["port_number"] - 1,
|
||||
@@ -359,12 +363,12 @@ def _convert_1_3_later(topo, topo_path):
|
||||
node["node_type"] = "frame_relay_switch"
|
||||
node["symbol"] = ":/symbols/frame_relay_switch.svg"
|
||||
node["console_type"] = None
|
||||
elif old_node["type"] in ["C1700", "C2600", "C2691", "C3600", "C3620", "C3640", "C3660", "C3725", "C3745", "C7200", "EtherSwitchRouter"]:
|
||||
elif old_node["type"].upper() in ["C1700", "C2600", "C2691", "C3600", "C3620", "C3640", "C3660", "C3725", "C3745", "C7200", "EtherSwitchRouter"]:
|
||||
if node["symbol"] is None:
|
||||
node["symbol"] = ":/symbols/router.svg"
|
||||
node["node_type"] = "dynamips"
|
||||
node["properties"]["dynamips_id"] = old_node.get("dynamips_id")
|
||||
if "platform" not in node["properties"] and old_node["type"].startswith("C"):
|
||||
if "platform" not in node["properties"] and old_node["type"].upper().startswith("C"):
|
||||
node["properties"]["platform"] = old_node["type"].lower()
|
||||
if node["properties"]["platform"].startswith("c36"):
|
||||
node["properties"]["platform"] = "c3600"
|
||||
|
||||
Reference in new issue
Block a user