Skip to content

Commit

Permalink
Fix AssertionError aleph.vm.orchestrator.views.status_check_fastapi
Browse files Browse the repository at this point in the history
Jira Issue: ALEPH-355
Sentry Issue: ALEPH-VM-STAGING-2G

Problem:

The diagnostic vm can return False or True for the ip check, return its result
instead of expecting true

 otherwise the whole status_check_fastapi was failing
  • Loading branch information
olethanh committed Jan 15, 2025
1 parent c2ad82a commit 09f6e84
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/aleph/vm/orchestrator/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ async def check_ipv4(session: ClientSession, vm_id: ItemHash) -> bool:
"""Check that the VM has IPv4 connectivity."""
try:
result: dict = await get_json_from_vm(session, vm_id, "/ip/4")
assert result["result"] is True
return True
return result["result"]

Check warning on line 101 in src/aleph/vm/orchestrator/status.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/orchestrator/status.py#L101

Added line #L101 was not covered by tests
except ClientResponseError:
return False

Expand All @@ -108,9 +107,7 @@ async def check_ipv6(session: ClientSession, vm_id: ItemHash) -> bool:
"""Check that the VM has IPv6 connectivity."""
try:
result: dict = await get_json_from_vm(session, vm_id, "/ip/6")
assert result["result"] is True
assert "headers" in result
return True
return result["result"]

Check warning on line 110 in src/aleph/vm/orchestrator/status.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/orchestrator/status.py#L110

Added line #L110 was not covered by tests
except ClientResponseError:
return False

Expand Down

0 comments on commit 09f6e84

Please sign in to comment.