Merge "Fix upgrade-charm hook that was only partly run"

This commit is contained in:
Zuul 2023-02-10 15:52:35 +00:00 committed by Gerrit Code Review
commit 987c4d43f9
1 changed files with 4 additions and 2 deletions

View File

@ -777,7 +777,7 @@ def update_nrpe_checks():
rabbit.remove_nrpe_files()
@hooks.hook('upgrade-charm')
@hooks.hook('upgrade-charm.real')
@harden()
def upgrade_charm():
pre_install_hooks()
@ -803,7 +803,9 @@ def upgrade_charm():
shutil.move(old, new)
rabbit.update_peer_cluster_status()
if not rabbit.clustered_with_leader():
# this should be run only when rabbitmq is not a single unit and
# being really part of a cluster
if not rabbit.clustered_with_leader() and config('min-cluster-size'):
serial = coordinator.Serial()
log("Requesting cluster join lock")
serial.acquire(rabbit.COORD_KEY_CLUSTER)