Skip to content

Commit

Permalink
Add warnings when forcing upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclert-canonical committed Nov 28, 2024
1 parent 60ad054 commit c234b4a
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit c234b4a

Please sign in to comment.