From 42cffe6228369a75f27c14eea22ad13baf2c0854 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 8 Feb 2010 19:24:37 +0000 Subject: Snapshots: Use custom bcfg2.conf when specified (Fix for #839) Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5716 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Snapshots.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/Server/Admin') diff --git a/src/lib/Server/Admin/Snapshots.py b/src/lib/Server/Admin/Snapshots.py index a68dec30d..004de0ddb 100644 --- a/src/lib/Server/Admin/Snapshots.py +++ b/src/lib/Server/Admin/Snapshots.py @@ -23,7 +23,8 @@ class Snapshots(Bcfg2.Server.Admin.Mode): def __init__(self, configfile): Bcfg2.Server.Admin.Mode.__init__(self, configfile) #self.session = Bcfg2.Server.Snapshots.setup_session(debug=True) - self.session = Bcfg2.Server.Snapshots.setup_session() + self.session = Bcfg2.Server.Snapshots.setup_session(configfile) + self.cfile = configfile def __call__(self, args): Bcfg2.Server.Admin.Mode.__call__(self, args) @@ -59,7 +60,7 @@ class Snapshots(Bcfg2.Server.Admin.Mode): raise SystemExit(1) elif args[0] == 'init': # Initialize the Snapshots database - dbpath = Bcfg2.Server.Snapshots.db_from_config() + dbpath = Bcfg2.Server.Snapshots.db_from_config(self.cfile) engine = sqlalchemy.create_engine(dbpath, echo=True) metadata = Base.metadata metadata.create_all(engine) -- cgit v1.2.3-1-g7c22