problem with updating connect_to
Somehow, updating the connect_to of connections gives problems. Specifically, what I have found, is that when I update the connect_to of multiple connections in a config file, only one of the connections is actually added to the network.
Consider the following yaml file (update_problem.yaml
):
network_name: test_network
node: &node
type: node
connection: &conn
type: Connection
connect_to:
node1: node_1
node2: node_2
port_name_node1: A
port_name_node2: B
label: connection
components:
node_1:
<<: *node
node_2:
<<: *node
node_3:
<<: *node
node_4:
<<: *node
conn_1:
<<: *conn
UPDATE:
connect_to:
node1: node_2
node2: node_3
conn_2:
<<: *conn
UPDATE:
connect_to:
node1: node_3
node2: node_4
and the following python file:
from netsquid_netconf.builder import ComponentBuilder
from netsquid_netconf.netconf import netconf_generator
from netsquid.nodes import Connection
ComponentBuilder.add_type("Connection", Connection)
network = next(netconf_generator("update_problem.yaml"))["network"]
print(network.connections)
The returned output is ConstrainedMapView({'conn|node_3<->node_4|connection': Connection(name='conn_2')})
, i.e. only the second connection is part of the final network.
I have toyed around a bit, and it really seems that this issue is restricted to updating connect_to. Updating properties of connections, for example, is no problem.
Edited by Hana Jirovska