Merge lp:~corey.bryant/heat/2015.1-b1-0ubuntu3 into lp:~ubuntu-server-dev/heat/kilo

Proposed by Corey Bryant
Status: Merged
Approved by: Chuck Short
Approved revision: 85
Merge reported by: Chuck Short
Merged at revision: not available
Proposed branch: lp:~corey.bryant/heat/2015.1-b1-0ubuntu3
Merge into: lp:~ubuntu-server-dev/heat/kilo
Diff against target: 71 lines (+51/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/oslo-i18n-private-classes.patch (+44/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~corey.bryant/heat/2015.1-b1-0ubuntu3
Reviewer Review Type Date Requested Status
Ubuntu Server Developers Pending
Review via email: mp+246196@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-01-12 09:22:27 +0000
3+++ debian/changelog 2015-01-12 17:44:21 +0000
4@@ -1,3 +1,9 @@
5+heat (2015.1~b1-0ubuntu3) UNRELEASED; urgency=medium
6+
7+ * d/p/oslo-i18n-private-classes.patch: Cherry picked from master.
8+
9+ -- Corey Bryant <corey.bryant@canonical.com> Mon, 12 Jan 2015 11:29:45 -0500
10+
11 heat (2015.1~b1-0ubuntu2) vivid; urgency=medium
12
13 [ Corey Bryant ]
14
15=== added file 'debian/patches/oslo-i18n-private-classes.patch'
16--- debian/patches/oslo-i18n-private-classes.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/oslo-i18n-private-classes.patch 2015-01-12 17:44:21 +0000
18@@ -0,0 +1,44 @@
19+From 40fa30fd741968a182e21f98d70ec256e542d49a Mon Sep 17 00:00:00 2001
20+From: Doug Hellmann <doug@doughellmann.com>
21+Date: Tue, 6 Jan 2015 10:56:10 -0500
22+Subject: [PATCH] Do not use private classes from oslo.i18n
23+
24+Use oslo.i18n.translate() without first testing if the argument being
25+passed is a Message instance. The Message class is meant to be hidden
26+from consumers, and translate() correctly detects untranslatable strings
27+and returns them as given.
28+
29+Change-Id: I6e907adf16d8cf6fbbcf526632c91ca81611ea09
30+---
31+ heat/common/wsgi.py | 15 ++-------------
32+ 1 file changed, 2 insertions(+), 13 deletions(-)
33+
34+diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py
35+index 86d6166..28608ec 100644
36+--- a/heat/common/wsgi.py
37++++ b/heat/common/wsgi.py
38+@@ -744,19 +744,8 @@ def translate_exception(exc, locale):
39+ exc.message = i18n.translate(six.text_type(exc), locale)
40+
41+ if isinstance(exc, webob.exc.HTTPError):
42+- # If the explanation is not a Message, that means that the
43+- # explanation is the default, generic and not translatable explanation
44+- # from webop.exc. Since the explanation is the error shown when the
45+- # exception is converted to a response, let's actually swap it with
46+- # message, since message is what gets passed in at construction time
47+- # in the API
48+- if not isinstance(exc.explanation, i18n._message.Message):
49+- exc.explanation = six.text_type(exc)
50+- exc.detail = ''
51+- else:
52+- exc.explanation = \
53+- i18n.translate(exc.explanation, locale)
54+- exc.detail = i18n.translate(exc.detail, locale)
55++ exc.explanation = i18n.translate(exc.explanation, locale)
56++ exc.detail = i18n.translate(getattr(exc, 'detail', ''), locale)
57+ return exc
58+
59+
60+--
61+2.1.0
62+
63
64=== modified file 'debian/patches/series'
65--- debian/patches/series 2015-01-05 20:56:10 +0000
66+++ debian/patches/series 2015-01-12 17:44:21 +0000
67@@ -1,3 +1,4 @@
68+oslo-i18n-private-classes.patch
69 remove-gettextutils-import.patch
70 #default-sqlite.patch
71 fix-requirements.patch

Subscribers

People subscribed via source and target branches