mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 16:28:11 +00:00
parent
e53db1ed81
commit
ef54367bf7
@ -310,20 +310,23 @@ def _convert_1_3_later(topo, topo_path):
|
||||
|
||||
# Create links
|
||||
for old_link in topo.get("links", []):
|
||||
nodes = []
|
||||
source_node = {
|
||||
"adapter_number": ports[old_link["source_port_id"]].get("adapter_number", 0),
|
||||
"port_number": ports[old_link["source_port_id"]].get("port_number", 0),
|
||||
"node_id": node_id_to_node_uuid[old_link["source_node_id"]]
|
||||
}
|
||||
nodes.append(source_node)
|
||||
try:
|
||||
nodes = []
|
||||
source_node = {
|
||||
"adapter_number": ports[old_link["source_port_id"]].get("adapter_number", 0),
|
||||
"port_number": ports[old_link["source_port_id"]].get("port_number", 0),
|
||||
"node_id": node_id_to_node_uuid[old_link["source_node_id"]]
|
||||
}
|
||||
nodes.append(source_node)
|
||||
|
||||
destination_node = {
|
||||
"adapter_number": ports[old_link["destination_port_id"]].get("adapter_number", 0),
|
||||
"port_number": ports[old_link["destination_port_id"]].get("port_number", 0),
|
||||
"node_id": node_id_to_node_uuid[old_link["destination_node_id"]]
|
||||
}
|
||||
nodes.append(destination_node)
|
||||
destination_node = {
|
||||
"adapter_number": ports[old_link["destination_port_id"]].get("adapter_number", 0),
|
||||
"port_number": ports[old_link["destination_port_id"]].get("port_number", 0),
|
||||
"node_id": node_id_to_node_uuid[old_link["destination_node_id"]]
|
||||
}
|
||||
nodes.append(destination_node)
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
link = {
|
||||
"link_id": str(uuid.uuid4()),
|
||||
|
Loading…
Reference in New Issue
Block a user