1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Fix crash when loading a topology without project id

This commit is contained in:
Julien Duponchelle 2016-08-31 09:42:05 +02:00
parent 7065988087
commit 03e31a2cb9
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 39 additions and 1 deletions

View File

@ -122,7 +122,7 @@ def _convert_1_3_later(topo, topo_path):
"version": __version__, "version": __version__,
"auto_start": topo.get("auto_start", False), "auto_start": topo.get("auto_start", False),
"name": topo["name"], "name": topo["name"],
"project_id": topo["project_id"], "project_id": topo.get("project_id"),
"topology": { "topology": {
"links": [], "links": [],
"drawings": [], "drawings": [],

View File

@ -0,0 +1,22 @@
{
"version" : "ANYSTR",
"name" : "Downloads",
"topology" : {
"links" : [],
"drawings" : [],
"nodes" : [],
"computes" : [
{
"protocol" : "http",
"name" : "Local",
"compute_id" : "local",
"port" : 8000,
"host" : "127.0.0.1"
}
]
},
"revision" : 5,
"project_id" : "ANYUUID",
"type" : "topology",
"auto_start" : false
}

View File

@ -0,0 +1,16 @@
{
"name": "Downloads",
"resources_type": "local",
"topology": {
"servers": [
{
"host": "127.0.0.1",
"id": 1,
"local": true,
"port": 8000
}
]
},
"type": "topology",
"version": "1.0"
}