Skip to content

Run pre-commit hooks #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2024
Merged
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
6 changes: 3 additions & 3 deletions simvue/factory/proxy/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ def set_alert_state(

@skip_if_failed("_aborted", "_suppress_errors", [])
def list_tags(self) -> list[dict[str, typing.Any]]:
#TODO: Tag retrieval not implemented for offline running
# TODO: Tag retrieval not implemented for offline running
raise NotImplementedError(
"Retrieval of current tags is not implemented for offline running"
)

@skip_if_failed("_aborted", "_suppress_errors", True)
def get_abort_status(self) -> bool:
#TODO: Abort on failure not implemented for offline running
# TODO: Abort on failure not implemented for offline running
return True

@skip_if_failed("_aborted", "_suppress_errors", [])
Expand Down
18 changes: 11 additions & 7 deletions simvue/factory/proxy/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,26 +466,30 @@ def check_token(self) -> bool:
self._error("Token has expired")
return False
return True

@skip_if_failed("_aborted", "_suppress_errors", False)
def get_abort_status(self) -> bool:
logger.debug("Retrieving alert status")

try:
response = get(
f"{self._url}/api/runs/{self._id}/abort", self._headers_mp
)
response = get(f"{self._url}/api/runs/{self._id}/abort", self._headers_mp)
except Exception as err:
self._error(f"Exception retrieving abort status: {str(err)}")
return False

logger.debug("Got status code %d when checking abort status", response.status_code)
logger.debug(
"Got status code %d when checking abort status", response.status_code
)

if response.status_code == 200:
if (status := response.json().get("status")) is None:
self._error(f"Expected key 'status' when retrieving abort status {response.json()}")
self._error(
f"Expected key 'status' when retrieving abort status {response.json()}"
)
return False
return status

self._error(f"Got status code {response.status_code} when checking abort status")
self._error(
f"Got status code {response.status_code} when checking abort status"
)
return False
Loading