mirror of
https://github.com/ansible/awx.git
synced 2026-01-27 00:21:30 -03:30
* Report single node clusters as non-ha * Move test file so we can make it use the database * Update unit test to accomidate different node types
16 lines
405 B
Python
16 lines
405 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.filter(node_type__in=('control', 'hybrid')).count() > 1:
|
|
return True
|
|
return False
|