awx/awx/main/ha.py
Matthew Jones 5605ec9754 Adjust usage of is_ha_environment()
Limit it to just instance count and make sure we use it for the mongo check
2015-07-08 14:18:04 -04:00

15 lines
360 B
Python

# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# AWX
from awx.main.models import Instance
def is_ha_environment():
"""Return True if this is an HA environment, and False
otherwise.
"""
# If there are two or more instances, then we are in an HA environment.
if Instance.objects.count() > 1:
return True
return False