Skip to content
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

[DPE-5711] Add warnings to destructive actions #188

Merged
merged 2 commits into from
Nov 28, 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
5 changes: 3 additions & 2 deletions src/machine_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,15 @@ def _on_force_upgrade_action(self, event: ops.ActionEvent) -> None:
logger.debug(f"Force upgrade event failed: {message}")
event.fail(message)
return
logger.debug("Forcing upgrade")

logger.warning("Forcing upgrade")
event.log(f"Forcefully upgrading {self.unit.name}")
self._upgrade.upgrade_unit(
event=event, workload_=self.get_workload(event=None), tls=self._tls_certificate_saved
)
self.reconcile()
event.set_results({"result": f"Forcefully upgraded {self.unit.name}"})
logger.debug("Forced upgrade")
logger.warning("Forced upgrade")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions src/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def _disable_tls(self) -> None:

def _disable_router(self) -> None:
"""Disable router and clean up corresponding router files."""
logger.debug("Disabling MySQL Router service")
logger.info("Disabling MySQL Router service")
sinclert-canonical marked this conversation as resolved.
Show resolved Hide resolved
self._container.update_mysql_router_service(enabled=False)
self._logrotate.disable()
self._container.router_config_directory.rmtree()
self._container.router_config_directory.mkdir()
self._router_data_directory.rmtree()
self._router_data_directory.mkdir()
logger.debug("Disabled MySQL Router service")
logger.info("Disabled MySQL Router service")

def reconcile(
self,
Expand Down
Loading