[gnuoy,r=james-page] Update default multicast port to avoid smoosh clash

This commit is contained in:
Liam Young 2015-01-23 13:19:56 +00:00
commit 8ce9445f84
3 changed files with 11 additions and 4 deletions

View File

@ -158,7 +158,7 @@ options:
with the other members of the HA Cluster. with the other members of the HA Cluster.
ha-mcastport: ha-mcastport:
type: int type: int
default: 5403 default: 5434
description: | description: |
Default multicast port number that will be used to communicate between Default multicast port number that will be used to communicate between
HA Cluster nodes. HA Cluster nodes.

View File

@ -155,6 +155,8 @@ def config_changed():
if settings: if settings:
for rid in relation_ids('cluster'): for rid in relation_ids('cluster'):
relation_set(relation_id=rid, relation_settings=settings) relation_set(relation_id=rid, relation_settings=settings)
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')
@ -391,7 +393,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 = {
'res_ks_haproxy': 'lsb:haproxy', 'res_ks_haproxy': 'lsb:haproxy',
@ -427,7 +429,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={CLUSTER_RES: ' '.join(vip_group)}) relation_set(relation_id=relation_id,
groups={CLUSTER_RES: ' '.join(vip_group)})
init_services = { init_services = {
'res_ks_haproxy': 'haproxy' 'res_ks_haproxy': 'haproxy'
@ -435,7 +438,8 @@ def ha_joined():
clones = { clones = {
'cl_ks_haproxy': 'res_ks_haproxy' 'cl_ks_haproxy': 'res_ks_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,

View File

@ -461,6 +461,7 @@ class KeystoneRelationTests(CharmTestCase):
self.get_netmask_for_address.return_value = '255.255.255.0' self.get_netmask_for_address.return_value = '255.255.255.0'
hooks.ha_joined() hooks.ha_joined()
args = { args = {
'relation_id': None,
'corosync_bindiface': 'em0', 'corosync_bindiface': 'em0',
'corosync_mcastport': '8080', 'corosync_mcastport': '8080',
'init_services': {'res_ks_haproxy': 'haproxy'}, 'init_services': {'res_ks_haproxy': 'haproxy'},
@ -486,6 +487,7 @@ class KeystoneRelationTests(CharmTestCase):
self.get_netmask_for_address.return_value = None self.get_netmask_for_address.return_value = None
hooks.ha_joined() hooks.ha_joined()
args = { args = {
'relation_id': None,
'corosync_bindiface': 'em0', 'corosync_bindiface': 'em0',
'corosync_mcastport': '8080', 'corosync_mcastport': '8080',
'init_services': {'res_ks_haproxy': 'haproxy'}, 'init_services': {'res_ks_haproxy': 'haproxy'},
@ -510,6 +512,7 @@ class KeystoneRelationTests(CharmTestCase):
self.get_netmask_for_address.return_value = '64' self.get_netmask_for_address.return_value = '64'
hooks.ha_joined() hooks.ha_joined()
args = { args = {
'relation_id': None,
'corosync_bindiface': 'em0', 'corosync_bindiface': 'em0',
'corosync_mcastport': '8080', 'corosync_mcastport': '8080',
'init_services': {'res_ks_haproxy': 'haproxy'}, 'init_services': {'res_ks_haproxy': 'haproxy'},