Only run peer-hooks for rabbit native clustering if no hacluster relation exists.

This commit is contained in:
Adam Gandelman 2013-03-06 15:15:03 -08:00
parent 486a809d62
commit ae9cb9e2e4
2 changed files with 11 additions and 1 deletions

View File

@ -56,6 +56,11 @@ def amqp_changed(relation_id=None, remote_unit=None):
def cluster_joined():
if utils.is_relation_made('ha'):
utils.juju_log('INFO',
'hacluster relation is present, skipping native '\
'rabbitmq cluster config.')
return
l_unit_no = os.getenv('JUJU_UNIT_NAME').split('/')[1]
r_unit_no = os.getenv('JUJU_REMOTE_UNIT').split('/')[1]
if l_unit_no > r_unit_no:
@ -71,6 +76,11 @@ def cluster_joined():
def cluster_changed():
if utils.is_relation_made('ha'):
utils.juju_log('INFO',
'hacluster relation is present, skipping native '\
'rabbitmq cluster config.')
return
l_unit_no = os.getenv('JUJU_UNIT_NAME').split('/')[1]
r_unit_no = os.getenv('JUJU_REMOTE_UNIT').split('/')[1]
if l_unit_no < r_unit_no:

View File

@ -1 +1 @@
76
77