From eee7d18c24eeb2254dda29e781f63bcd64553b7d Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Thu, 5 Mar 2015 11:45:43 +0800 Subject: [PATCH] Remove str() before exc to make sure lazy translation work Use of str() on an lazy translation enabled message may cause runtime failure. Change-Id: Ib38b146ae3188241b082fb446f26ea67704797af --- heat/engine/resources/aws/cfn/stack.py | 4 ++-- heat/engine/volume_tasks.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/heat/engine/resources/aws/cfn/stack.py b/heat/engine/resources/aws/cfn/stack.py index 94b03d48f..cfc5ee401 100644 --- a/heat/engine/resources/aws/cfn/stack.py +++ b/heat/engine/resources/aws/cfn/stack.py @@ -61,7 +61,7 @@ class NestedStack(stack_resource.StackResource): raise ValueError(_("Could not fetch remote template '%(url)s': " "%(exc)s") % {'url': self.properties[self.TEMPLATE_URL], - 'exc': str(r_exc)}) + 'exc': r_exc}) return template_format.parse(template_data) @@ -105,7 +105,7 @@ class NestedStack(stack_resource.StackResource): raise ValueError(_("Could not fetch remote template '%(url)s': " "%(exc)s") % {'url': self.properties[self.TEMPLATE_URL], - 'exc': str(r_exc)}) + 'exc': r_exc}) template = template_format.parse(template_data) diff --git a/heat/engine/volume_tasks.py b/heat/engine/volume_tasks.py index e19f9bd52..0a0c4f494 100644 --- a/heat/engine/volume_tasks.py +++ b/heat/engine/volume_tasks.py @@ -49,7 +49,7 @@ class VolumeExtendTask(object): if self.clients.client_plugin('cinder').is_client_exception(ex): raise exception.Error(_( "Failed to extend volume %(vol)s - %(err)s") % { - 'vol': vol.id, 'err': str(ex)}) + 'vol': vol.id, 'err': ex}) else: raise