equate unix socket file to localhost for ha

This commit is contained in:
Chris Meyers
2015-05-22 12:20:25 -04:00
parent ebdc7a9648
commit b4c0d2b3b3
3 changed files with 38 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ def is_ha_environment():
# If the database is not local, then we are in an HA environment.
host = settings.DATABASES['default'].get('HOST', 'localhost')
if host and host.lower() not in ('127.0.0.1', 'localhost'):
if host and host.lower() not in ('127.0.0.1', 'localhost') and not host.startswith('/'):
return True
# We are not in an HA environment.