summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/settings.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-18 20:53:05 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-06-28 14:28:46 +0200
commit58f4b311bfa9f192c9d4d4a418e9f0db5bce1897 (patch)
treef3ee4613351bd3186380436834b8a256cc5c77a0 /src/lib/Bcfg2/settings.py
parentb9022e96e1353dab0843e6341239469dec773b1f (diff)
downloadbcfg2-58f4b311bfa9f192c9d4d4a418e9f0db5bce1897.tar.gz
bcfg2-58f4b311bfa9f192c9d4d4a418e9f0db5bce1897.tar.bz2
bcfg2-58f4b311bfa9f192c9d4d4a418e9f0db5bce1897.zip
Options: add database.options
With the options setting in the database section of the config file various database options for the django database could be set (like ssl mode for postgres). For more information, consult your django databse backend module's documentation.
Diffstat (limited to 'src/lib/Bcfg2/settings.py')
-rw-r--r--src/lib/Bcfg2/settings.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/settings.py b/src/lib/Bcfg2/settings.py
index 9adfd66bf..6e718a079 100644
--- a/src/lib/Bcfg2/settings.py
+++ b/src/lib/Bcfg2/settings.py
@@ -26,6 +26,7 @@ DATABASE_USER = None
DATABASE_PASSWORD = None
DATABASE_HOST = None
DATABASE_PORT = None
+DATABASE_OPTIONS = None
TIME_ZONE = None
@@ -58,8 +59,8 @@ def read_config(cfile=DEFAULT_CONFIG, repo=None, quiet=False):
""" read the config file and set django settings based on it """
# pylint: disable=W0602,W0603
global DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, \
- DATABASE_HOST, DATABASE_PORT, DEBUG, TEMPLATE_DEBUG, TIME_ZONE, \
- MEDIA_URL
+ DATABASE_HOST, DATABASE_PORT, DATABASE_OPTIONS, DEBUG, \
+ TEMPLATE_DEBUG, TIME_ZONE, MEDIA_URL
# pylint: enable=W0602,W0603
if not os.path.exists(cfile) and os.path.exists(DEFAULT_CONFIG):
@@ -86,7 +87,8 @@ def read_config(cfile=DEFAULT_CONFIG, repo=None, quiet=False):
USER=setup['db_user'],
PASSWORD=setup['db_password'],
HOST=setup['db_host'],
- PORT=setup['db_port'])
+ PORT=setup['db_port'],
+ OPTIONS=setup['db_options'])
if HAS_DJANGO and django.VERSION[0] == 1 and django.VERSION[1] < 2:
DATABASE_ENGINE = setup['db_engine']
@@ -95,6 +97,7 @@ def read_config(cfile=DEFAULT_CONFIG, repo=None, quiet=False):
DATABASE_PASSWORD = DATABASES['default']['PASSWORD']
DATABASE_HOST = DATABASES['default']['HOST']
DATABASE_PORT = DATABASES['default']['PORT']
+ DATABASE_OPTIONS = DATABASES['default']['OPTIONS']
# dropping the version check. This was added in 1.1.2
TIME_ZONE = setup['time_zone']