summaryrefslogtreecommitdiffstats
path: root/reports
diff options
context:
space:
mode:
authorMichael Fenn <fennm@deshawresearch.com>2014-04-11 14:53:31 -0400
committerMichael Fenn <fennm@deshawresearch.com>2014-04-11 14:53:31 -0400
commit88b6227c495061b536097cac31ea98dada7d25ca (patch)
tree1c0b055d16fa0285ece37065a0a6dc052f34f8de /reports
parent44c4d214a1f3ea057fbcf6d22de4c586b31cf661 (diff)
downloadbcfg2-88b6227c495061b536097cac31ea98dada7d25ca.tar.gz
bcfg2-88b6227c495061b536097cac31ea98dada7d25ca.tar.bz2
bcfg2-88b6227c495061b536097cac31ea98dada7d25ca.zip
Handle the case where BCFG2_CONFIG_FILE isn't set in the environment
Diffstat (limited to 'reports')
-rw-r--r--reports/reports.wsgi4
1 files changed, 2 insertions, 2 deletions
diff --git a/reports/reports.wsgi b/reports/reports.wsgi
index 711f64712..7113b3308 100644
--- a/reports/reports.wsgi
+++ b/reports/reports.wsgi
@@ -2,7 +2,6 @@ import os
import Bcfg2.Options
import Bcfg2.DBSettings
-os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.DBSettings'
config_parsed = False
import django.core.handlers.wsgi
@@ -13,7 +12,8 @@ def application(environ, start_response):
# with wsgi, the environment isn't present in os.environ, but
# is passwd to the application function
- os.environ['BCFG2_CONFIG_FILE'] = environ['BCFG2_CONFIG_FILE']
+ if 'BCFG2_CONFIG_FILE' in environ:
+ os.environ['BCFG2_CONFIG_FILE'] = environ['BCFG2_CONFIG_FILE']
if not config_parsed:
Bcfg2.Options.get_parser().parse()
config_parsed = True