From ca682fb3627bf9d2750462a4c53bdfd99b14a131 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Wed, 20 Apr 2016 10:15:06 -0400 Subject: [PATCH] remove connection error in fresh install, mongo setting in dev environment --- awx/main/migrations/_system_tracking.py | 4 ++++ awx/settings/local_settings.py.docker_compose | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/migrations/_system_tracking.py b/awx/main/migrations/_system_tracking.py index 71206d253e..7750a3e69f 100644 --- a/awx/main/migrations/_system_tracking.py +++ b/awx/main/migrations/_system_tracking.py @@ -20,6 +20,10 @@ def migrate_facts(apps, schema_editor): Fact = apps.get_model('main', "Fact") Host = apps.get_model('main', "Host") + if (not hasattr(settings, 'MONGO_HOST')) or settings.MONGO_HOST == NotImplemented: + # If settings do not specify a mongo database, do not raise error or drop db + return (0, 0) + try: n = FactVersion.objects.all().count() except ConnectionError: diff --git a/awx/settings/local_settings.py.docker_compose b/awx/settings/local_settings.py.docker_compose index 67ab89e87e..f3606ff7c5 100644 --- a/awx/settings/local_settings.py.docker_compose +++ b/awx/settings/local_settings.py.docker_compose @@ -51,7 +51,7 @@ if is_testing(sys.argv): BROKER_URL = 'redis://redis/' # Mongo host configuration -MONGO_HOST = 'mongo' +MONGO_HOST = NotImplemented # Set True to enable additional logging from the job_event_callback plugin JOB_CALLBACK_DEBUG = False