First go on rearranging haproxy and apache. Needs some refactoring.

This commit is contained in:
Ante Karamatic
2014-02-14 21:56:58 +01:00
parent 704b1f8dbe
commit d7afa5ad96
5 changed files with 27 additions and 17 deletions

View File

@@ -126,6 +126,13 @@ def determine_api_port(public_port):
return public_port - (i * 10)
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 +
@@ -136,8 +143,6 @@ 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)