]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Truncate fail_reason to column length
authorVipin Balachandran <vbala@vmware.com>
Thu, 9 Oct 2014 14:05:46 +0000 (19:35 +0530)
committerVipin Balachandran <vbala@vmware.com>
Thu, 9 Oct 2014 14:37:08 +0000 (20:07 +0530)
commit82716b4ac836024b968c76db75be8a92ede0e226
tree1a606d71880feb378721e8c7f9f8a87549eec5e9
parentcbf3f27bd608482467a0cdbb0c9f54978c2f1c08
Truncate fail_reason to column length

During create_backup failure handling, backup_update fails with
DataError ("Data too long for column") if the fail_reason is
greater than 255 characters. As a result, backup status is stuck
in 'creating' state. This patch avoids the problem by truncating
fail_reason to 255 characters before update.

Closes-Bug: #1376199
Change-Id: If0d616b81d3869f7ea110caab8cf4140cf5c5c9e
cinder/db/sqlalchemy/models.py
cinder/tests/test_db_api.py