]> 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)
committerThomas Goirand <thomas@goirand.fr>
Sun, 14 Dec 2014 09:18:31 +0000 (09:18 +0000)
commit6de3e2e5b3f890f48bc33ef1f30acfad65a83aeb
treec64a3d1925f91befcc954a5f7a837b23b40d0cbd
parent1b49739a3905d6394586750e72afd1b88d0b98a5
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
(cherry picked from commit 82716b4ac836024b968c76db75be8a92ede0e226)
cinder/db/sqlalchemy/models.py
cinder/tests/test_db_api.py