mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix reformat with template usage, try to catch IOError to have nice error message when file system is full
This commit is contained in:
parent
b85cc13d08
commit
fb56f3fe00
@ -436,13 +436,15 @@ class PGLoader:
|
||||
self._parse_fields('c_reformat', config.get(name, 'reformat'),
|
||||
btype = True, argtype = 'string')
|
||||
else:
|
||||
self.c_reformat = self.reformat = None
|
||||
# remember reformat could have been configured from template
|
||||
if 'c_reformat' not in self.__dict__:
|
||||
self.c_reformat = self.reformat = None
|
||||
|
||||
if DEBUG:
|
||||
print 'reformat', self.c_reformat
|
||||
|
||||
# check the configure reformating is available
|
||||
if self.c_reformat:
|
||||
if not self.template and self.c_reformat:
|
||||
import imp
|
||||
self.reformat = []
|
||||
|
||||
@ -481,7 +483,7 @@ class PGLoader:
|
||||
(r_module, r_function)
|
||||
self.config_errors += 1
|
||||
|
||||
if DEBUG:
|
||||
if DEBUG and not self.template:
|
||||
print 'reformat', self.reformat
|
||||
|
||||
##
|
||||
|
||||
@ -85,8 +85,11 @@ class Reject:
|
||||
|
||||
# now we close the two fds
|
||||
for f in [fd_log, fd_data]:
|
||||
f.flush()
|
||||
f.close()
|
||||
try:
|
||||
f.flush()
|
||||
f.close()
|
||||
except IOError, e:
|
||||
raise PGLoader_Error, e
|
||||
|
||||
self.errors += 1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user