]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Avoid serializing CinderExceptions before they are translated
authorLuis A. Garcia <luis@linux.vnet.ibm.com>
Mon, 19 Aug 2013 20:19:57 +0000 (20:19 +0000)
committerLuis A. Garcia <luis@linux.vnet.ibm.com>
Mon, 19 Aug 2013 23:05:43 +0000 (23:05 +0000)
commit2bec15e185e844dff757e09fa72a3b61d91e5f96
treed45a7469148b802d8d6326e600104706ade1cc5b
parent5d6c11facc330fc320474d76e137fbdf899097b4
Avoid serializing CinderExceptions before they are translated

CinderExceptions were being unicode()'d when being wrapped in an
HTTPException, and this was causing the delayed translation to fail for
those errors.

Also, CinderExceptions have a 'message' class attribute that holds the
generic error message template, e.g. "Backup  %(backup_id)s is not
found", unfortunately, because the names are the same, it was
overshadowing the actual exception instance 'message', e.g. "Backup 1 is
not found", when translating. This patch puts the exception's actual
message in a new field called 'msg'.

Fixes Bug: #1214102

Change-Id: Ied9abcc3d05454852c0a5891432eb181220a744e
cinder/api/contrib/backups.py
cinder/api/contrib/types_extra_specs.py
cinder/api/contrib/volume_actions.py
cinder/api/contrib/volume_transfer.py
cinder/api/contrib/volume_type_encryption.py
cinder/api/openstack/wsgi.py
cinder/api/v1/snapshot_metadata.py
cinder/api/v1/volume_metadata.py
cinder/api/v2/snapshot_metadata.py
cinder/exception.py
cinder/tests/api/contrib/test_backups.py