]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix translation of CinderExceptions in REST API
authorLuis A. Garcia <luis@linux.vnet.ibm.com>
Tue, 24 Sep 2013 22:07:55 +0000 (22:07 +0000)
committerLuis A. Garcia <luis@linux.vnet.ibm.com>
Wed, 25 Sep 2013 20:07:38 +0000 (20:07 +0000)
commita1a898c4667b8e99d733f1391e0d325c8ce6e187
treebad5d67a86c4c3c671212b02d7b3eb6c55094018
parent1094467f9b5f6c929cce5aea435aa6faa066d4d7
Fix translation of CinderExceptions in REST API

When creating a Fault from a CinderException wrapped in an
HTTPException, we were converting the inner explanation to unicode
before it was able to reach the Fault's call() method which is where
translation occurs, and unicode objects can't be translated.

This patch preserves the CinderException's Message object and puts it in
another Message object as the explanation to the HTTPException so it can
be translated.

Fixes bug: #1229967

Change-Id: Ida71908b639da32b4b85846a117ef21da2fe685b
cinder/api/middleware/fault.py
cinder/tests/test_wsgi.py