Skip to content

Commit

Permalink
Merge pull request #70 from atlanticwave-sdx/fix_empty_pull_topology
Browse files Browse the repository at this point in the history
Add sanity check to avoid sending empty topology to SDX-LC
  • Loading branch information
italovalcy authored Sep 21, 2024
2 parents 07d860f + 2e13de7 commit 3091669
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def post_topology_to_sdxlc(self, converted_topology):
@rest("topology/2.0.0", methods=["GET"])
def get_sdx_topology_v2(self, _request: Request) -> JSONResponse:
"""return sdx topology v2"""
if not self._converted_topo.get("nodes"):
return JSONResponse({}, status_code=200)
return JSONResponse(self._converted_topo)

@rest("topology/2.0.0", methods=["POST"])
Expand Down

0 comments on commit 3091669

Please sign in to comment.