Adjust usage of is_ha_environment()

Limit it to just instance count and make sure we use it for the mongo check
This commit is contained in:
Matthew Jones
2015-07-08 14:18:04 -04:00
parent d5e948890c
commit 5605ec9754
2 changed files with 3 additions and 33 deletions

View File

@@ -5,7 +5,7 @@ import sys
from optparse import make_option
from django.core.management.base import BaseCommand
from awx.main.models import Instance
from awx.main.ha import is_ha_environment
from awx.main.task_engine import TaskSerializer
@@ -45,7 +45,7 @@ class Command(BaseCommand):
# rules here will grow more complicated over time.
uses_mongo = system_tracking # noqa
if Instance.objects.count() > 1 and kwargs['local'] and uses_mongo:
if is_ha_environment() and kwargs['local'] and uses_mongo:
print("HA Configuration detected. Database should be remote")
uses_mongo = False