Propogate corosync config option set in the charm to the hacluster subordinate

This commit is contained in:
Liam Young 2015-01-22 16:27:00 +00:00
parent 47d0460c7b
commit c5224d8e10

View File

@ -130,7 +130,9 @@ def config_changed():
for rid in relation_ids('cluster'): for rid in relation_ids('cluster'):
cluster_joined(relation_id=rid) cluster_joined(relation_id=rid)
for r_id in relation_ids('ha'):
ha_joined(relation_id=r_id)
@hooks.hook('shared-db-relation-joined') @hooks.hook('shared-db-relation-joined')
def db_joined(): def db_joined():
@ -323,7 +325,7 @@ def cluster_changed():
@hooks.hook('ha-relation-joined') @hooks.hook('ha-relation-joined')
def ha_joined(): def ha_joined(relation_id=None):
cluster_config = get_hacluster_config() cluster_config = get_hacluster_config()
resources = { resources = {
@ -361,7 +363,8 @@ def ha_joined():
vip_group.append(vip_key) vip_group.append(vip_key)
if len(vip_group) >= 1: if len(vip_group) >= 1:
relation_set(groups={'grp_cinder_vips': ' '.join(vip_group)}) relation_set(relation_id=relation_id,
groups={'grp_cinder_vips': ' '.join(vip_group)})
init_services = { init_services = {
'res_cinder_haproxy': 'haproxy' 'res_cinder_haproxy': 'haproxy'
@ -369,7 +372,8 @@ def ha_joined():
clones = { clones = {
'cl_cinder_haproxy': 'res_cinder_haproxy' 'cl_cinder_haproxy': 'res_cinder_haproxy'
} }
relation_set(init_services=init_services, relation_set(relation_id=relation_id,
init_services=init_services,
corosync_bindiface=cluster_config['ha-bindiface'], corosync_bindiface=cluster_config['ha-bindiface'],
corosync_mcastport=cluster_config['ha-mcastport'], corosync_mcastport=cluster_config['ha-mcastport'],
resources=resources, resources=resources,