mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 19:38:57 +00:00
Fix conversion issue for old IOU projects
Fix https://github.com/GNS3/gns3-gui/issues/1868
This commit is contained in:
parent
a730fce514
commit
7fea6f0e2e
@ -331,6 +331,14 @@ def _convert_1_3_later(topo, topo_path):
|
||||
node["symbol"] = ":/symbols/vbox_guest.svg"
|
||||
elif old_node["type"] == "IOUDevice":
|
||||
node["node_type"] = "iou"
|
||||
node["port_name_format"] = old_node.get("port_name_format", "Ethernet{segment0}/{port0}")
|
||||
node["port_segment_size"] = int(old_node.get("port_segment_size", "4"))
|
||||
if node["symbol"] is None:
|
||||
if "l2" in node["properties"].get("path", ""):
|
||||
node["symbol"] = ":/symbols/multilayer_switch.svg"
|
||||
else:
|
||||
node["symbol"] = ":/symbols/router.svg"
|
||||
|
||||
elif old_node["type"] == "Cloud":
|
||||
old_node["ports"] = _create_cloud(node, old_node, ":/symbols/cloud.svg")
|
||||
elif old_node["type"] == "Host":
|
||||
|
@ -30,8 +30,8 @@
|
||||
"name": "IOU1",
|
||||
"node_id": "aaeb2288-a7d8-42a9-b9d8-c42ab464a390",
|
||||
"node_type": "iou",
|
||||
"port_name_format": "Ethernet{0}",
|
||||
"port_segment_size": 0,
|
||||
"port_name_format": "Ethernet{segment0}/{port0}",
|
||||
"port_segment_size": 4,
|
||||
"first_port_name": null,
|
||||
"properties": {
|
||||
"ethernet_adapters": 2,
|
||||
|
Loading…
Reference in New Issue
Block a user