Skip to content

Commit

Permalink
keep two endpoints in response
Browse files Browse the repository at this point in the history
  • Loading branch information
YufengXin committed Oct 23, 2024
1 parent c6470a3 commit 3e03585
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ profile = "black"
src_paths = ["sdx_controller", "bapm_server"]

[tool.pytest.ini_options]
addopts = "--cov=sdx_controller --cov=bapm_server --cov-report html --cov-report term-missing"
addopts = "--cov=sdx_controller --cov=bapm_server"
testpaths = [
"sdx_controller/test"
]
Expand Down
26 changes: 20 additions & 6 deletions sdx_controller/handlers/connection_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,17 @@ def get_connection_status(db, service_id: str):
endpoints.append(endpoint_a)

if request_uni_a_id == uni_a_port:
response_endpoints.append(endpoint_a)

(
response_endpoints.append(endpoint_a)
if endpoint_a not in response_endpoints
else None
)
if request_uni_z_id == uni_a_port:
response_endpoints.append(endpoint_a)
(
response_endpoints.append(endpoint_a)
if endpoint_a not in response_endpoints
else None
)

uni_z_port = breakdown.get("uni_z").get("port_id")
uni_z_vlan = breakdown.get("uni_z").get("tag").get("value")
Expand All @@ -413,10 +420,17 @@ def get_connection_status(db, service_id: str):
endpoints.append(endpoint_z)

if request_uni_a_id == uni_z_port:
response_endpoints.append(endpoint_z)
(
response_endpoints.append(endpoint_z)
if endpoint_z not in response_endpoints
else None
)
if request_uni_z_id == uni_z_port:
response_endpoints.append(endpoint_z)

(
response_endpoints.append(endpoint_z)
if endpoint_z not in response_endpoints
else None
)
print(
f"endpoints info: {request_uni_a_id}, {request_uni_z_id}, {uni_a_port}, {uni_z_port}"
)
Expand Down

0 comments on commit 3e03585

Please sign in to comment.