atlanticwave-sdx / pce

Path Computation Element for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
0 stars 3 forks source link

New topology data model spec defines Link object with a list of string representing port ids #196

Closed italovalcy closed 4 months ago

italovalcy commented 4 months ago

Hi,

The Topology Data Model spec now defines the Link object with a list of strings representing the Port IDs. Please see the new example here for Ampath and PR https://github.com/atlanticwave-sdx/datamodel/pull/132.

The new spec is available here: https://docs.google.com/document/d/1lgxjIT144EFu1G_OVcU19hN1cSUT_v2-tE0Z-7UlkNg/edit#heading=h.wkntjr6wpqi9

With this new change, we will have to make some adjustments on the way PCE manages the topology through the TopologyManager component. For example: https://github.com/atlanticwave-sdx/pce/blob/main/src/sdx_pce/topology/manager.py#L116

Currently, exporting a topology in 2.0.0 format will result in issues like the one below:

sdx-controller  | Exception in thread Thread-2:
sdx-controller  | Traceback (most recent call last):
sdx-controller  |   File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
sdx-controller  |     self.run()
sdx-controller  |   File "/usr/local/lib/python3.9/threading.py", line 917, in run
sdx-controller  |     self._target(*self._args, **self._kwargs)
sdx-controller  |   File "/opt/venv/lib/python3.9/site-packages/sdx_controller/messaging/rpc_queue_consumer.py", line 122, in start_sdx_consumer
sdx-controller  |     self.te_manager.add_topology(topo_json)
sdx-controller  |   File "/opt/venv/lib/python3.9/site-packages/sdx_pce/topology/temanager.py", line 72, in add_topology
sdx-controller  |     self.topology_manager.add_topology(topology_data)
sdx-controller  |   File "/opt/venv/lib/python3.9/site-packages/sdx_pce/topology/manager.py", line 119, in add_topology
sdx-controller  |     self._port_map[port["id"]] = link
sdx-controller  | TypeError: string indices must be integers