Skip to content

Commit

Permalink
Disable overwatcher checks in emergency_close and shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 26, 2024
1 parent 9c7c94a commit 88a8509
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/gort/gort.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
get_temporary_file_path,
kubernetes_list_deployments,
kubernetes_restart_deployment,
overwatcher_is_running,
run_in_executor,
)

Expand Down Expand Up @@ -665,11 +664,11 @@ async def notify_event(self, event: Event, payload: dict[str, Any] = {}):
async def emergency_close(self):
"""Parks and closes the telescopes."""

if await overwatcher_is_running(self):
self.log.warning(
"Overwatcher is running but overriding. However "
"be aware that the Overwatcher could reopen the enclosure."
)
# if await overwatcher_is_running(self):
# self.log.warning(
# "Overwatcher is running but overriding. However "
# "be aware that the Overwatcher could reopen the enclosure."
# )

tasks = []
tasks.append(self.telescopes.park(disable=True))
Expand Down Expand Up @@ -986,11 +985,11 @@ async def startup(self, **kwargs):
async def shutdown(self, **kwargs):
"""Executes the :obj:`shutdown <.ShutdownRecipe>` sequence."""

if await overwatcher_is_running(self):
raise GortError(
"Overwatcher is running. Cannot shutdown. If you really need "
"to shutdown, execute Gort.emergency_close()."
)
# if await overwatcher_is_running(self):
# raise GortError(
# "Overwatcher is running. Cannot shutdown. If you really need "
# "to shutdown, execute Gort.emergency_close()."
# )

return await self.execute_recipe("shutdown", **kwargs)

Expand Down
1 change: 1 addition & 0 deletions src/gort/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ async def is_actor_running(actor: str, client: AMQPClient | None = None):
if not client:
client = await AMQPClient().start()

# TODO: this can fail if the event loop has closed the client connection.
ping = await client.send_command(actor, "ping")
if ping.status.did_succeed:
return True
Expand Down

0 comments on commit 88a8509

Please sign in to comment.