Skip to content

Commit

Permalink
Show error on upgrade action (#432)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
  • Loading branch information
marceloneppel authored Apr 4, 2024
1 parent d24e511 commit b77fad2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ def pre_upgrade_check(self) -> None:
# to the other units to make some of them simple replicas and enable the fist
# unit to become a sync-standby before we can trigger a switchover to it).
self._set_list_of_sync_standbys()
raise ClusterNotReadyError(
default_message,
f"{unit_zero_name} needs to be a synchronous standby in order to become the primary before the upgrade process can start",
f"wait 30 seconds for {unit_zero_name} and run this action again",
)
cause = f"{unit_zero_name} needs to be a synchronous standby in order to become the primary before the upgrade process can start"
resolution = f"wait 30 seconds for {unit_zero_name} to become a synchronous standby and run this action again"
action_message = f"{cause} - {resolution}"
raise ClusterNotReadyError(action_message, cause, resolution)

def _set_list_of_sync_standbys(self) -> None:
"""Set the list of desired sync-standbys in the relation data."""
Expand Down

0 comments on commit b77fad2

Please sign in to comment.