summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Snapshots/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Snapshots/__init__.py')
-rw-r--r--src/lib/Server/Snapshots/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Server/Snapshots/__init__.py b/src/lib/Server/Snapshots/__init__.py
index c13dee42e..6018377cb 100644
--- a/src/lib/Server/Snapshots/__init__.py
+++ b/src/lib/Server/Snapshots/__init__.py
@@ -5,9 +5,9 @@ import sqlalchemy.orm
import ConfigParser
-def db_from_config(fname='/etc/bcfg2.conf'):
+def db_from_config(cfile):
cp = ConfigParser.ConfigParser()
- cp.read([fname])
+ cp.read([cfile])
driver = cp.get('snapshots', 'driver')
if driver == 'sqlite':
path = cp.get('snapshots', 'database')
@@ -22,8 +22,8 @@ def db_from_config(fname='/etc/bcfg2.conf'):
raise Exception, "unsupported db driver %s" % driver
-def setup_session(debug=False):
- engine = sqlalchemy.create_engine(db_from_config(),
+def setup_session(cfile, debug=False):
+ engine = sqlalchemy.create_engine(db_from_config(cfile),
echo=debug)
Session = sqlalchemy.orm.sessionmaker()
Session.configure(bind=engine)