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

Correct link are not connected to the correct ethernet switch port after conversion

Fix https://github.com/GNS3/gns3-gui/issues/1797
This commit is contained in:
Julien Duponchelle 2017-01-23 13:34:11 +01:00
parent f90e6f2f5b
commit dc40b0296e
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 29 additions and 1 deletions

View File

@ -341,6 +341,8 @@ def _convert_1_3_later(topo, topo_path):
node_id_to_node_uuid[old_node["id"]] = node["node_id"] node_id_to_node_uuid[old_node["id"]] = node["node_id"]
for port in old_node.get("ports", []): for port in old_node.get("ports", []):
if node["node_type"] in ("ethernet_hub", "ethernet_switch"):
port["port_number"] -= 1
ports[port["id"]] = port ports[port["id"]] = port
new_topo["topology"]["nodes"].append(node) new_topo["topology"]["nodes"].append(node)

View File

@ -14,7 +14,23 @@
} }
], ],
"drawings": [], "drawings": [],
"links": [], "links": [
{
"link_id": "ANYUUID",
"nodes": [
{
"port_number": 1,
"node_id": "ANYUUID",
"adapter_number": 0
},
{
"port_number": 1,
"node_id": "ANYUUID",
"adapter_number": 0
}
]
}
],
"nodes": [ "nodes": [
{ {
"compute_id": "local", "compute_id": "local",

View File

@ -4,6 +4,16 @@
"project_id": "644e3892-4a50-4457-9601-2234d4842169", "project_id": "644e3892-4a50-4457-9601-2234d4842169",
"revision": 4, "revision": 4,
"topology": { "topology": {
"links": [
{
"description": "",
"destination_node_id": 3,
"destination_port_id": 10,
"id": 1,
"source_node_id": 2,
"source_port_id": 2
}
],
"nodes": [ "nodes": [
{ {
"description": "ATM switch", "description": "ATM switch",