summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorJoey Hagedorn <hagedorn@mcs.anl.gov>2007-06-25 21:49:10 +0000
committerJoey Hagedorn <hagedorn@mcs.anl.gov>2007-06-25 21:49:10 +0000
commit69ae493b872a61003b0ff53d69e23b669102f47e (patch)
treef542e105da78ee3bac156d4b10eb0e1dc2479afa /src/lib/Server
parent5dc9881ac52e2a6cb9c326931a0e5c92f138c74f (diff)
downloadbcfg2-69ae493b872a61003b0ff53d69e23b669102f47e.tar.gz
bcfg2-69ae493b872a61003b0ff53d69e23b669102f47e.tar.bz2
bcfg2-69ae493b872a61003b0ff53d69e23b669102f47e.zip
moved reporting system configuration to /etc/bcfg2.conf
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3366 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Reports/settings.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py
index df781c890..0e7dbe3c5 100644
--- a/src/lib/Server/Reports/settings.py
+++ b/src/lib/Server/Reports/settings.py
@@ -2,9 +2,12 @@
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
c = ConfigParser()
c.read(['/etc/bcfg2.conf'])#This needs to be configurable one day somehow
-sqlitedbpath = "%s/etc/brpt.sqlite" % c.get('server', 'repository')
-DEBUG = True
+if c.get('statistics', 'web_debug') == "True":
+ DEBUG = True
+else:
+ DEBUG = False
+
TEMPLATE_DEBUG = DEBUG
ADMINS = (
@@ -13,12 +16,22 @@ ADMINS = (
MANAGERS = ADMINS
-DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
-DATABASE_NAME = sqlitedbpath # Or path to database file if using sqlite3.
-DATABASE_USER = '' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+DATABASE_ENGINE = c.get('statistics', 'database_engine')
+# 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
+DATABASE_NAME = c.get('statistics', 'database_name')
+# Or path to database file if using sqlite3.
+#<repository>/etc/brpt.sqlite is default path
+DATABASE_USER = c.get('statistics', 'database_user')
+# Not used with sqlite3.
+DATABASE_PASSWORD = c.get('statistics', 'database_password')
+# Not used with sqlite3.
+DATABASE_HOST = c.get('statistics', 'database_host')
+# Set to empty string for localhost. Not used with sqlite3.
+DATABASE_PORT = c.get('statistics', 'database_port')
+# Set to empty string for default. Not used with sqlite3.
+
+if DATABASE_ENGINE == 'sqlite3' and DATABASE_NAME == '':
+ DATABASE_NAME = "%s/etc/brpt.sqlite" % c.get('server', 'repository')
# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE