From c234b4aa9a00fb3bf369075b24981b58136fcc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinclert=20P=C3=A9rez?= Date: Thu, 28 Nov 2024 16:16:56 +0100 Subject: [PATCH 1/2] Add warnings when forcing upgrade --- src/machine_charm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/machine_charm.py b/src/machine_charm.py index cdc2bdc6..45c727e0 100755 --- a/src/machine_charm.py +++ b/src/machine_charm.py @@ -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__": From dc2146d6ea8cdde9bd31f9bdf825760e075b0fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinclert=20P=C3=A9rez?= Date: Thu, 28 Nov 2024 16:17:06 +0100 Subject: [PATCH 2/2] Add info when disabling router --- src/workload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/workload.py b/src/workload.py index 33131e7b..56fd7411 100644 --- a/src/workload.py +++ b/src/workload.py @@ -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") 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,