Cleanup before MP

This commit is contained in:
Ante Karamatic 2014-02-16 20:17:42 +01:00
parent 2a6124ec60
commit a8eaa92af8
3 changed files with 8 additions and 15 deletions

View File

@ -143,6 +143,8 @@ def determine_haproxy_port(public_port):
returns: int: the correct listening port for the HAProxy service
'''
i = 0
if https():
i += 1
return public_port - (i * 10)

View File

@ -29,7 +29,6 @@ from charmhelpers.core.hookenv import (
from charmhelpers.contrib.hahelpers.cluster import (
determine_apache_port,
determine_api_port,
determine_haproxy_port,
https,
is_clustered,
peer_units,

View File

@ -6,7 +6,7 @@ from charmhelpers.fetch import apt_install, filter_installed_packages
from charmhelpers.contrib.openstack import context, neutron, utils
from charmhelpers.contrib.hahelpers.cluster import (
determine_apache_port, determine_api_port, determine_haproxy_port)
determine_apache_port, determine_api_port)
class ApacheSSLContext(context.ApacheSSLContext):
@ -83,32 +83,24 @@ class HAProxyContext(context.HAProxyContext):
port_mapping = {
'nova-api-os-compute': [
determine_haproxy_port(api_port('nova-api-os-compute')),
a_compute_api,
],
api_port('nova-api-os-compute'), a_compute_api],
'nova-api-ec2': [
determine_haproxy_port(api_port('nova-api-ec2')),
a_ec2_api,
],
api_port('nova-api-ec2'), a_ec2_api],
'nova-objectstore': [
determine_haproxy_port(api_port('nova-objectstore')),
a_s3_api,
],
api_port('nova-objectstore'), a_s3_api],
}
if relation_ids('nova-volume-service'):
port_mapping.update({
'nova-api-ec2': [
determine_haproxy_port(api_port('nova-api-ec2')),
a_nvol_api],
api_port('nova-api-ec2'), a_nvol_api],
})
listen_ports['osapi_volume_listen_port'] = nvol_api
if neutron.network_manager() in ['neutron', 'quantum']:
port_mapping.update({
'neutron-server': [
determine_haproxy_port(api_port('neutron-server')),
a_neutron_api]
api_port('neutron-server'), a_neutron_api]
})
# quantum/neutron.conf listening port, set separte from nova's.
ctxt['neutron_bind_port'] = neutron_api