Skip to content

Commit

Permalink
simplifying the 'endpoints' parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
YufengXin committed Jun 28, 2024
1 parent 96a44a6 commit 0b869fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/sdx_datamodel/parsing/connectionhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ def import_connection_data(self, data: dict) -> Connection:
name = data["name"]
bandwidth_required = None
latency_required = None
if data.get("ingress_port") is None: # spec version 2.0.0
if data.get("endpoints") is not None: # spec version 2.0.0
endpoints = data.get("endpoints")
if endpoints is None:
raise MissingAttributeException(data, "ingress_port")
if len(endpoints) != 2:
raise ValueError("endpoints must have 2 elements")
ingress_port = self._make_port(endpoints[0], "")
Expand Down

0 comments on commit 0b869fa

Please sign in to comment.