diff --git a/hooks/charmhelpers/contrib/hahelpers/cluster.py b/hooks/charmhelpers/contrib/hahelpers/cluster.py index f6e741d3..c34be69c 100644 --- a/hooks/charmhelpers/contrib/hahelpers/cluster.py +++ b/hooks/charmhelpers/contrib/hahelpers/cluster.py @@ -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) diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index 60a47229..e29c5e02 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -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, diff --git a/hooks/nova_cc_context.py b/hooks/nova_cc_context.py index 55a4ea93..d6cafccc 100644 --- a/hooks/nova_cc_context.py +++ b/hooks/nova_cc_context.py @@ -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