Merge "Fix single unit upgrade-charm"

This commit is contained in:
Zuul 2019-12-19 12:58:58 +00:00 committed by Gerrit Code Review
commit 14e70b68e0

View File

@ -798,7 +798,11 @@ def leader_node():
'''
# Each rabbitmq node should join_cluster with the leader
# to avoid split-brain clusters.
leader_node_hostname = peer_retrieve('leader_node_hostname')
try:
leader_node_hostname = peer_retrieve('leader_node_hostname')
except ValueError:
# This is a single unit
return None
if leader_node_hostname:
return "rabbit@" + leader_node_hostname
else: