Support multi-network vip configuration

This commit is contained in:
James Page
2014-07-16 14:15:57 +01:00
parent 039df785c0
commit 294bcff583
4 changed files with 37 additions and 13 deletions

View File

@@ -40,6 +40,8 @@ TO_PATCH = [
'relation_ids',
'relation_set',
'unit_get',
'get_iface_for_address',
'get_netmask_for_address',
]
NEUTRON_CONF_DIR = "/etc/neutron"
@@ -277,20 +279,21 @@ class NeutronAPIHooksTests(CharmTestCase):
'ha-bindiface': 'eth1',
'ha-mcastport': '5405',
}
vip_params = 'params ip="%s" cidr_netmask="%s" nic="%s"' % \
(_ha_config['vip'], _ha_config['vip_cidr'],
_ha_config['vip_iface'])
vip_params = 'params ip="%s" cidr_netmask="255.255.255.0" nic="%s"' % \
(_ha_config['vip'], _ha_config['vip_iface'])
_get_ha_config.return_value = _ha_config
self.get_iface_for_address.return_value = 'eth0'
self.get_netmask_for_address.return_value = '255.255.255.0'
_relation_data = {
'init_services': {'res_neutron_haproxy': 'haproxy'},
'corosync_bindiface': _ha_config['ha-bindiface'],
'corosync_mcastport': _ha_config['ha-mcastport'],
'resources': {
'res_neutron_vip': 'ocf:heartbeat:IPaddr2',
'res_neutron_eth0_vip': 'ocf:heartbeat:IPaddr2',
'res_neutron_haproxy': 'lsb:haproxy'
},
'resource_params': {
'res_neutron_vip': vip_params,
'res_neutron_eth0_vip': vip_params,
'res_neutron_haproxy': 'op monitor interval="5s"'
},
'clones': {'cl_nova_haproxy': 'res_neutron_haproxy'}