Always allow the /ping/ endpoint, even on secondaries.

Also, if content is None, it does not have the keys we are checking for
in the ./configure script.
This commit is contained in:
Luke Sneeringer 2014-12-17 13:09:58 -06:00
parent efee35bf70
commit c02647cf04

View File

@ -84,6 +84,10 @@ class HAMiddleware(object):
if Instance.objects.my_role() == 'primary':
return None
# Always allow the /ping/ endpoint.
if request.path.startswith('/api/v1/ping'):
return None
# Get the primary instance.
primary = Instance.objects.primary()