summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-01-27 19:24:59 +0100
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-07-23 17:52:39 +0200
commit650623f8f5425ac4b629d19a1d4db79459d4f43e (patch)
tree5d03a39bc3ea182899eb1ff48b5ae80341b38595
parent4b459822a94d1b73931c4afe997a214c4fcfade1 (diff)
downloadbcfg2-650623f8f5425ac4b629d19a1d4db79459d4f43e.tar.gz
bcfg2-650623f8f5425ac4b629d19a1d4db79459d4f43e.tar.bz2
bcfg2-650623f8f5425ac4b629d19a1d4db79459d4f43e.zip
DBSettings: Add possibility to specify arbitrary django options.
-rw-r--r--doc/man/bcfg2.conf.txt5
-rw-r--r--man/bcfg2.conf.55
-rw-r--r--src/lib/Bcfg2/DBSettings.py9
3 files changed, 18 insertions, 1 deletions
diff --git a/doc/man/bcfg2.conf.txt b/doc/man/bcfg2.conf.txt
index 62c4ac1a8..2f014812e 100644
--- a/doc/man/bcfg2.conf.txt
+++ b/doc/man/bcfg2.conf.txt
@@ -718,6 +718,11 @@ Reporting options
Maximum number of children for the reporting collector. Use 0 to
disable the limit. (default is 0)
+ django_settings
+ Arbitrary options for the Django installation. The value expected
+ is a literal python dictionary, that is merged with the already set
+ django settings.
+
See Also
--------
diff --git a/man/bcfg2.conf.5 b/man/bcfg2.conf.5
index 13000a719..ba5158a0d 100644
--- a/man/bcfg2.conf.5
+++ b/man/bcfg2.conf.5
@@ -778,6 +778,11 @@ Turn on Django debugging.
.B max_children
Maximum number of children for the reporting collector. Use 0 to
disable the limit. (default is 0)
+.TP
+.B django_settings
+Arbitrary options for the Django installation. The value expected
+is a literal python dictionary, that is merged with the already set
+django settings.
.UNINDENT
.UNINDENT
.UNINDENT
diff --git a/src/lib/Bcfg2/DBSettings.py b/src/lib/Bcfg2/DBSettings.py
index 1c8c34978..3e101405d 100644
--- a/src/lib/Bcfg2/DBSettings.py
+++ b/src/lib/Bcfg2/DBSettings.py
@@ -123,6 +123,9 @@ def finalize_django_config(opts=None, silent=False):
opts.web_prefix.rstrip('/') + \
settings['MEDIA_URL']
+ if opts.django_settings:
+ settings.update(opts.django_settings)
+
logger = logging.getLogger()
logger.debug("Finalizing Django settings: %s" % settings)
@@ -265,7 +268,11 @@ class _OptionContainer(object):
Bcfg2.Options.BooleanOption(
cf=('reporting', 'web_debug'), help='Django debug'),
Bcfg2.Options.Option(
- cf=('reporting', 'web_prefix'), help='Web prefix')]
+ cf=('reporting', 'web_prefix'), help='Web prefix'),
+ Bcfg2.Options.Option(
+ cf=('reporting', 'django_settings'),
+ help='Additional django settings',
+ type=Bcfg2.Options.Types.literal_dict, default=dict())]
@staticmethod
def component_parsed_hook(opts):