Only connect to the database after having read both template and specific configuration

This commit is contained in:
dim 2007-11-28 08:40:57 +00:00
parent 0426dcb4f0
commit 141d8ec19a

View File

@ -101,6 +101,10 @@ class PGLoader:
self.filename, self.input_encoding,
self.table, self.columns)
# Now reset database connection
if not DRY_RUN:
self.db.reset()
if DEBUG:
print '%s init done' % name
print
@ -529,10 +533,6 @@ class PGLoader:
mesg = 'Configuration errors for section %s' % self.name
raise PGLoader_Error, mesg
# Now reset database connection
if not DRY_RUN:
self.db.reset()
def _parse_fields(self, attr, str, btype = False, argtype = 'int'):
""" parse the user string str for fields definition to store
into self.attr """