Save hostnames, not IP addresses, for HA.

This commit is contained in:
Luke Sneeringer
2014-12-02 10:34:22 -06:00
parent 4afa7a0d4d
commit d6699353e5
4 changed files with 501 additions and 10 deletions

View File

@@ -156,9 +156,9 @@ class ApiV1PingView(APIView):
# Add all of the instances into the structure.
for instance in Instance.objects.all():
if instance.primary:
response['instances']['primary'] = instance.ip_address
response['instances']['primary'] = instance.hostname
else:
response['instances']['secondaries'].append(instance.ip_address)
response['instances']['secondaries'].append(instance.hostname)
response['instances']['secondaries'].sort()
# Done; return the response.