[migractions] Don't silently ignore errors when installing sql procedures
If we're going to ignore errors, at least be loud about it.
sqlexec already wraps the sql execution in a try/except block, so we
were never going to catch any exceptions in the caller. Check the
return value instead. Closes #3459618.
--- a/server/migractions.py Tue Jan 21 10:20:49 2014 +0100
+++ b/server/migractions.py Tue Jan 21 11:57:02 2014 +0100
@@ -395,11 +395,10 @@
sql_scripts = glob(osp.join(directory, '*.%s.sql' % driver))
for fpath in sql_scripts:
print '-> installing', fpath
- try:
- sqlexec(open(fpath).read(), self.session.system_sql, False,
- delimiter=';;')
- except Exception as exc:
- print '-> ERROR:', exc, ', skipping', fpath
+ failed = sqlexec(open(fpath).read(), self.session.system_sql, False,
+ delimiter=';;')
+ if failed:
+ print '-> ERROR, skipping', fpath
# schema synchronization internals ########################################