AC-752 Update settings to support enabling celeryd using rabbitmq on upgrade, also support config files in /etc/awx/conf.d/.

This commit is contained in:
Chris Church
2014-01-02 11:19:07 -05:00
parent a4098a6df7
commit fc6ec26ebe
5 changed files with 117 additions and 20 deletions

View File

@@ -2,21 +2,25 @@
# All Rights Reserved.
# Development settings for AWX project.
# Python
import sys
import traceback
# Django Split Settings
from split_settings.tools import optional, include
# Load default settings.
from defaults import *
# If a local_settings.py file is present in awx/settings/, use it to override
# If any local_*.py files are present in awx/settings/, use them to override
# default settings for development. If not present, we can still run using
# only the defaults.
try:
local_settings_file = os.path.join(os.path.dirname(__file__),
'local_settings.py')
execfile(local_settings_file)
# Hack so that the autoreload will detect changes to local_settings.py.
class dummymodule(str):
__file__ = property(lambda self: self)
sys.modules['local_settings'] = dummymodule(local_settings_file)
except IOError, e:
from django.core.exceptions import ImproperlyConfigured
if os.path.exists(local_settings_file):
msg = 'Unable to load %s: %s' % (local_settings_file, str(e))
raise ImproperlyConfigured(msg)
include(
optional('local_*.py'),
scope=locals(),
)
except ImportError:
traceback.print_exc()
sys.exit(1)