removing adding hosts, it can be done on context
This commit is contained in:
parent
9d0ed43e94
commit
ef5a1521ed
|
@ -68,19 +68,6 @@ def amqp_changed(relation_id=None, remote_unit=None, needs_leader=True):
|
|||
if utils.is_relation_made('ha'):
|
||||
# active/passive settings
|
||||
relation_settings['vip'] = utils.config_get('vip')
|
||||
relation_settings['hosts'] = None
|
||||
|
||||
# check for active/active
|
||||
peers = cluster.peer_units()
|
||||
if len(peers) > 0:
|
||||
relation_settings['vip'] = None
|
||||
hosts = []
|
||||
hosts.append(utils.unit_get('private-address'))
|
||||
for peer in peers:
|
||||
peer_hostname = utils.relation_get('private-address',
|
||||
rid=relation_id, unit=peer)
|
||||
hosts.append(peer_hostname+':5672')
|
||||
relation_settings['hosts'] = ','.join(hosts)
|
||||
|
||||
if relation_id:
|
||||
relation_settings['rid'] = relation_id
|
||||
|
@ -137,11 +124,6 @@ def cluster_changed():
|
|||
rabbit.service('start')
|
||||
rabbit.cluster_with(remote_host)
|
||||
|
||||
# need to iterate over all the relationships and refresh hosts
|
||||
for rid in utils.relation_ids('amqp'):
|
||||
for unit in utils.relation_list(rid):
|
||||
amqp_changed(relation_id=rid, remote_unit=unit, needs_leader=False)
|
||||
|
||||
def ha_joined():
|
||||
corosync_bindiface = utils.config_get('ha-bindiface')
|
||||
corosync_mcastport = utils.config_get('ha-mcastport')
|
||||
|
|
Loading…
Reference in New Issue