atlanticwave-sdx / datamodel

Parsing and validation library for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
0 stars 1 forks source link

Ports in Links and Nodes are dicts, not Port objects #95

Open sajith opened 1 year ago

sajith commented 1 year ago

These lines in LinkHandler look right:

https://github.com/atlanticwave-sdx/datamodel/blob/cb8c653b50b225f6bb540bc7905daaf9cdbdca9e/src/sdx/datamodel/parsing/linkhandler.py#L18 https://github.com/atlanticwave-sdx/datamodel/blob/cb8c653b50b225f6bb540bc7905daaf9cdbdca9e/src/sdx/datamodel/parsing/linkhandler.py#L37

Also these lines in NodeHandler:

https://github.com/atlanticwave-sdx/datamodel/blob/cb8c653b50b225f6bb540bc7905daaf9cdbdca9e/src/sdx/datamodel/parsing/nodehandler.py#L19 https://github.com/atlanticwave-sdx/datamodel/blob/cb8c653b50b225f6bb540bc7905daaf9cdbdca9e/src/sdx/datamodel/parsing/nodehandler.py#L32

sajith commented 11 months ago

It is probably better to leave this alone for now, until we have made some progress on #92. The discussion on https://github.com/atlanticwave-sdx/sdx-controller/pull/190 also is relevant.

In the interim, when implementing L2VPN pieces in pce, I think we can make do with Ports encoded-as-dicts.

YufengXin commented 1 month ago

node.set_ports() returns the Port objects because it call port_handler(), while link.set_ports() returns dict, -> node.ports (Port) and link.ports (dict).

As a reminder when make changes.