Skip to content

Commit

Permalink
test_automatic_host_removal: Improve teardown process
Browse files Browse the repository at this point in the history
Include explicit hosts' removal within the test's teardown in case
something goes wrong within the automatic hosts' removal.

Change-Id: Ia5e7b45bc57bf9c6d1657bc91c3a80998148a7c2
  • Loading branch information
MatteoStifano committed Dec 12, 2024
1 parent 80c3bbb commit 632083b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/composition/test_automatic_host_removal.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ def _host_removal_done() -> bool:
raise
finally:
central_site.openapi.rules.delete(rule_id=rule_id)
if unresolvable_host_central in [_.get("id") for _ in central_site.openapi.hosts.get_all()]:
central_site.openapi.hosts.delete(unresolvable_host_central)
if unresolvable_host_remote in [_.get("id") for _ in remote_site.openapi.hosts.get_all()]:
remote_site.openapi.hosts.delete(unresolvable_host_remote)
central_site.openapi.activate_changes_and_wait_for_completion(force_foreign_changes=True)

0 comments on commit 632083b

Please sign in to comment.