summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-09-22 18:54:49 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-09-22 18:54:49 +0000
commit78c67fca3ca6c9973d7ada5cd0d9ccf7c6d55f18 (patch)
tree491c43d4958a471582847e274566b5d3f0550be3 /src
parent464979b67cf7bb7337cbe34719be94ef391ae002 (diff)
downloadbcfg2-78c67fca3ca6c9973d7ada5cd0d9ccf7c6d55f18.tar.gz
bcfg2-78c67fca3ca6c9973d7ada5cd0d9ccf7c6d55f18.tar.bz2
bcfg2-78c67fca3ca6c9973d7ada5cd0d9ccf7c6d55f18.zip
Remove empty option requirements in bcfg2.conf for sqlite3
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4918 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Reports/settings.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py
index 66f774f2d..83cfeeccb 100644
--- a/src/lib/Server/Reports/settings.py
+++ b/src/lib/Server/Reports/settings.py
@@ -1,4 +1,4 @@
-# Django settings for bcfg reports project.
+# Django settings for bcfg2 reports project.
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
c = ConfigParser()
c.read(['/etc/bcfg2.conf', '/etc/bcfg2-web.conf'])
@@ -23,18 +23,22 @@ MANAGERS = ADMINS
DATABASE_ENGINE = c.get('statistics', 'database_engine')
# 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
-DATABASE_NAME = c.get('statistics', 'database_name')
+if c.has_option('statistics', 'database_name'):
+ DATABASE_NAME = c.get('statistics', 'database_name')
+else:
+ 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':
+ 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')