summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Reports
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Server/Reports')
-rw-r--r--src/lib/Bcfg2/Server/Reports/settings.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/settings.py b/src/lib/Bcfg2/Server/Reports/settings.py
index 26bd5076e..9eb558ac8 100644
--- a/src/lib/Bcfg2/Server/Reports/settings.py
+++ b/src/lib/Bcfg2/Server/Reports/settings.py
@@ -1,11 +1,16 @@
import django
+import os
import sys
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
# Django settings for bcfg2 reports project.
c = ConfigParser.ConfigParser()
-if len(c.read(['/etc/bcfg2.conf', '/etc/bcfg2-web.conf'])) == 0:
+if 'BCFG2_CONFIG_FILE' in os.environ:
+ cfiles=os.environ['BCFG2_CONFIG_FILE']
+else:
+ cfiles=['/etc/bcfg2.conf', '/etc/bcfg2-web.conf']
+if len(c.read(cfiles)) == 0:
raise ImportError("Please check that bcfg2.conf or bcfg2-web.conf exists "
"and is readable by your web server.")