mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-01 19:50:59 +00:00
parent
c96bd5f2a9
commit
0be973f2c5
@ -230,7 +230,9 @@ def _convert_1_3_later(topo, topo_path):
|
|||||||
elif old_node["type"] == "IOUDevice":
|
elif old_node["type"] == "IOUDevice":
|
||||||
node["node_type"] = "iou"
|
node["node_type"] = "iou"
|
||||||
elif old_node["type"] == "Cloud":
|
elif old_node["type"] == "Cloud":
|
||||||
_create_cloud(node, old_node)
|
_create_cloud(node, old_node, ":/symbols/cloud.svg")
|
||||||
|
elif old_node["type"] == "Host":
|
||||||
|
_create_cloud(node, old_node, ":/symbols/computer.svg")
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("Conversion of {} is not supported".format(old_node["type"]))
|
raise NotImplementedError("Conversion of {} is not supported".format(old_node["type"]))
|
||||||
|
|
||||||
@ -418,9 +420,9 @@ def _convert_label(label):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _create_cloud(node, old_node):
|
def _create_cloud(node, old_node, icon):
|
||||||
node["node_type"] = "cloud"
|
node["node_type"] = "cloud"
|
||||||
node["symbol"] = ":/symbols/cloud.svg"
|
node["symbol"] = icon
|
||||||
node["console_type"] = None
|
node["console_type"] = None
|
||||||
node["console"] = None
|
node["console"] = None
|
||||||
del old_node["properties"]["nios"]
|
del old_node["properties"]["nios"]
|
||||||
|
52
tests/topologies/1_5_host/after/1_5_host.gns3
Normal file
52
tests/topologies/1_5_host/after/1_5_host.gns3
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"auto_start": false,
|
||||||
|
"name": "1_5_host",
|
||||||
|
"project_id": "ce17e635-bc1b-44df-946c-149e938dedc4",
|
||||||
|
"revision": 5,
|
||||||
|
"topology": {
|
||||||
|
"computes": [
|
||||||
|
{
|
||||||
|
"compute_id": "local",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"name": "Local",
|
||||||
|
"port": 3080,
|
||||||
|
"protocol": "http"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"drawings": [],
|
||||||
|
"links": [],
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"compute_id": "local",
|
||||||
|
"console": null,
|
||||||
|
"console_type": null,
|
||||||
|
"label": {
|
||||||
|
"rotation": 0,
|
||||||
|
"style": "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
|
||||||
|
"text": "Host 1",
|
||||||
|
"x": 13,
|
||||||
|
"y": -25
|
||||||
|
},
|
||||||
|
"name": "Host 1",
|
||||||
|
"node_id": "ANYUUID",
|
||||||
|
"node_type": "cloud",
|
||||||
|
"properties": {
|
||||||
|
"interfaces": [
|
||||||
|
],
|
||||||
|
"ports": [
|
||||||
|
{"interface": "bridge0", "port_number": 1, "type": "ethernet", "name": "bridge0"},
|
||||||
|
{"interface": "en0", "port_number": 2, "type": "ethernet", "name": "en0"},
|
||||||
|
{"interface": "en1", "port_number": 3, "type": "ethernet", "name": "en1"},
|
||||||
|
{"interface": "en2", "port_number": 4, "type": "ethernet", "name": "en2"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"symbol": ":/symbols/computer.svg",
|
||||||
|
"x": -69,
|
||||||
|
"y": -82,
|
||||||
|
"z": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": "topology",
|
||||||
|
"version": "ANYSTR"
|
||||||
|
}
|
68
tests/topologies/1_5_host/before/1_5_host.gns3
Normal file
68
tests/topologies/1_5_host/before/1_5_host.gns3
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"auto_start": false,
|
||||||
|
"name": "1_5_host",
|
||||||
|
"project_id": "ce17e635-bc1b-44df-946c-149e938dedc4",
|
||||||
|
"revision": 4,
|
||||||
|
"topology": {
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"description": "Host",
|
||||||
|
"id": 1,
|
||||||
|
"label": {
|
||||||
|
"color": "#ff000000",
|
||||||
|
"font": "TypeWriter,10,-1,5,75,0,0,0,0,0",
|
||||||
|
"text": "Host 1",
|
||||||
|
"x": 13.2734375,
|
||||||
|
"y": -25.0
|
||||||
|
},
|
||||||
|
"ports": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "nio_gen_eth:bridge0",
|
||||||
|
"stub": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"name": "nio_gen_eth:en0",
|
||||||
|
"stub": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"name": "nio_gen_eth:en1",
|
||||||
|
"stub": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"name": "nio_gen_eth:en2",
|
||||||
|
"stub": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"name": "Host 1",
|
||||||
|
"nios": [
|
||||||
|
"nio_gen_eth:bridge0",
|
||||||
|
"nio_gen_eth:en0",
|
||||||
|
"nio_gen_eth:en1",
|
||||||
|
"nio_gen_eth:en2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"server_id": 1,
|
||||||
|
"type": "Host",
|
||||||
|
"x": -69.5,
|
||||||
|
"y": -82.5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"servers": [
|
||||||
|
{
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"id": 1,
|
||||||
|
"local": true,
|
||||||
|
"port": 3080,
|
||||||
|
"protocol": "http",
|
||||||
|
"vm": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": "topology",
|
||||||
|
"version": "1.5.1"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user