Update charm-helpers

This commit is contained in:
Ante Karamatic 2014-02-17 13:10:27 +01:00
parent 6819375450
commit fdd6ad41ba

@ -127,23 +127,16 @@ def determine_api_port(public_port):
def determine_apache_port(public_port):
i = 0
if len(peer_units()) > 0 or is_clustered():
i += 1
return public_port - (i * 10)
def determine_haproxy_port(public_port):
'''
Description: Determine correct proxy listening port based on public IP +
existence of HTTPS reverse proxy.
Description: Determine correct apache listening port based on public IP +
state of the cluster.
public_port: int: standard public port for given service
returns: int: the correct listening port for the HAProxy service
'''
i = 0
if https():
if len(peer_units()) > 0 or is_clustered():
i += 1
return public_port - (i * 10)