Skip to content

Commit

Permalink
More fix
Browse files Browse the repository at this point in the history
  • Loading branch information
congwang09 committed Oct 25, 2024
1 parent e45b5e3 commit d4b6a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sdx_controller/controllers/l2vpn_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def patch_connection(service_id, body=None): # noqa: E501
f"Placing new connection {service_id} with te_manager: {current_app.te_manager}"
)
reason, code = connection_handler.place_connection(current_app.te_manager, body)
if code == 200:
if code // 100 == 2:
db_instance.add_key_value_pair_to_db(
"connections", service_id, json.dumps(body)
)
Expand All @@ -212,7 +212,7 @@ def patch_connection(service_id, body=None): # noqa: E501
)
response = {
"service_id": service_id,
"status": "OK" if code == 201 else "Failure",
"status": "OK" if code // 100 == 2 else "Failure",
"reason": reason,
}
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion sdx_controller/test/test_l2vpn_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_place_connection_with_three_topologies_added_in_sequence(self):
if idx in [0, 1]:
# Expect 400 failure because TEManager do not have all
# the topologies yet.
assert response.status_code // 100 == 2
assert response.status_code // 100 == 4
if idx == 200:
# Expect 200 success now that TEManager should be set
# up with all the expected topology data.
Expand Down

0 comments on commit d4b6a4e

Please sign in to comment.