Make sure we don't throw away exception on SQL script failure

If SQL script failed, we don't currently log the failure anywhere, so
users have hard time debugging an issue, if anything arises.

Let's log the failure before proceeding with rollback.

Change-Id: Ic92b1403c00bb238a68265a15150a4be6f6b2346
This commit is contained in:
Ihar Hrachyshka 2014-07-29 17:25:24 +02:00
parent feb0c15aee
commit be1dd6730a
1 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,8 @@ class SqlScript(base.BaseScript):
else:
conn.execute(text)
trans.commit()
except:
except Exception as e:
log.error("SQL script %s failed: %s", self.path, e)
trans.rollback()
raise
finally: