Skip to content
Open
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
4 changes: 3 additions & 1 deletion states/_modules/cfutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,6 @@ def get_colo_names(timeout=10: int, backup=True: bool) -> list[str]:
return []

if backup:
return __salt__["provision_api.get_names"](type="colo", timeout=timeout)
return __salt__["provision_api.get_names"](type="colo", timeout=timeout)
else:
return []
5 changes: 5 additions & 0 deletions tests/pytests/unit/_modules/test_cfutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def test_get_colo_names_timeout_from_zinc_falls_back_to_provision_api() -> None:
with mock_server("provision_api", "get_names", 200, ["provision_api_colo"]):
assert cfutils.get_colo_names() == ["provision_api_colo"]

# Slow test due to the wait for a Zinc timeout (10s)
@pytest.mark.slow
def test_get_colo_names_timeout_from_zinc_with_no_backup() -> None:
assert cfutils.get_colo_names(backup = False) == []

# Really slow test due to wait for both Zinc and Provision API timeout (20s)
@pytest.mark.slow
def test_get_colo_names_returns_error_on_backup_failure() -> None:
Expand Down