Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a method:TEManager.add_breakdowns_to_connection(connection_reques… #188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/sdx_pce/topology/temanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ def get_links_on_path(self, solution: ConnectionSolution) -> list:

return result

def add_breakdowns_to_connection(self, connection_request: dict, breakdowns: dict):
"""
add breakdowns to connection request for the sdx-controller to process.
"""
connection_request["breakdowns"] = breakdowns

return connection_request

def generate_connection_breakdown(
self, solution: ConnectionSolution, connection_request: dict
) -> dict:
Expand Down
8 changes: 8 additions & 0 deletions tests/test_te_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@ def test_connection_amlight_to_zaoxi(self):
)
print(f"breakdown: {json.dumps(breakdown)}")

connection_request = temanager.add_breakdowns_to_connection(
connection_request, breakdown
)

temanager._logger.info(
f"connection_request with breakdowns: {connection_request}"
)

# Note that the "domain" key is correct in the breakdown
# result when we initialize TEManager with None for topology,
# and later add individual topologies with add_topology().
Expand Down