Skip to content

Commit

Permalink
Move exporter installed check to top of update status
Browse files Browse the repository at this point in the history
  • Loading branch information
dashmage committed Mar 21, 2024
1 parent 47a403a commit 1df3586
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def _on_update_status(self, _: EventBase) -> None: # noqa: C901
# The charm should be in BlockedStatus with install failed msg
return # type: ignore[unreachable]

if not self._stored.exporter_installed: # type: ignore[truthy-function]
# The charm should be in BlockedStatus with exporter install failed msg
return # type: ignore[unreachable]

config_valid, config_valid_message = self.validate_exporter_configs()
if not config_valid:
self.model.unit.status = BlockedStatus(config_valid_message)
Expand All @@ -143,10 +147,6 @@ def _on_update_status(self, _: EventBase) -> None: # noqa: C901
self.model.unit.status = BlockedStatus(error_msg)
return

if not self._stored.exporter_installed: # type: ignore[truthy-function]
logger.warning("Exporter not installed") # type: ignore[unreachable]
return

if not self.exporter.check_health():
logger.warning("Exporter health check - failed.")
# if restart isn't successful, an ExporterError exception will be raised here
Expand Down

0 comments on commit 1df3586

Please sign in to comment.