From 69ae493b872a61003b0ff53d69e23b669102f47e Mon Sep 17 00:00:00 2001 From: Joey Hagedorn Date: Mon, 25 Jun 2007 21:49:10 +0000 Subject: 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 --- src/lib/Server/Reports/settings.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src') 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. +#/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 -- cgit v1.2.3-1-g7c22