Merge lp:~cbjchen/cinder/lp1514325 into lp:~ubuntu-server-dev/cinder/kilo

Proposed by Liang Chen
Status: Rejected
Rejected by: Marc Deslauriers
Proposed branch: lp:~cbjchen/cinder/lp1514325
Merge into: lp:~ubuntu-server-dev/cinder/kilo
Diff against target: 75 lines (+55/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/encode-repr-return.patch (+47/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~cbjchen/cinder/lp1514325
Reviewer Review Type Date Requested Status
Marc Deslauriers Disapprove
Review via email: mp+281351@code.launchpad.net

Description of the change

SRU LP#1514325

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the work. The bug doesn't mention if the issue is fixed in wily and xenial, could you check and update the report? Is there also a point doing a SRU for vivid now, knowing it's neither a LTS nor a current stable version...

Revision history for this message
Liang Chen (cbjchen) wrote :

Hi Sebastien,

Thank you for considering the merge proposal.
The code that introduces this bug was moved to an independent project(python-oslo.versionedobjects) for wily and later. So fix will need to be done there. I have backported the fix into stable/liberty branch in OpenStack upstream repository. And I can propose a SRU for ubuntu python-oslo.versionedobjects package if the fix has not been brought in. But for cinder package, nothing needs to be done for wily and later.

Thanks.
Liang

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for the merge request, but since vivid is now End of Life, I am rejecting it.

review: Disapprove

Unmerged revisions

238. By lchen <<email address hidden>@canonical.com>

SRU LP: #1514325

* Fix unicode volue name error. (LP:#1514325):
  - d/p encode-repr-return.patch: ensure __repr__ return value encoded

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-10-16 14:48:47 +0000
3+++ debian/changelog 2015-12-25 06:33:38 +0000
4@@ -1,3 +1,10 @@
5+cinder (1:2015.1.2-0ubuntu2) vivid; urgency=medium
6+
7+ * Fix unicode volue name error. (LP:#1514325):
8+ - d/p encode-repr-return.patch: ensure __repr__ return value encoded
9+
10+ -- Liang Chen <liang.chen@canonical.com> Thu, 24 Dec 2015 09:44:29 +0000
11+
12 cinder (1:2015.1.2-0ubuntu1) vivid; urgency=medium
13
14 [ Chuck Short ]
15
16=== added file 'debian/patches/encode-repr-return.patch'
17--- debian/patches/encode-repr-return.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/encode-repr-return.patch 2015-12-25 06:33:38 +0000
19@@ -0,0 +1,47 @@
20+From d9d68c7fb26b36e86641ed45356584a60b699a81 Mon Sep 17 00:00:00 2001
21+From: Liang Chen <liang.chen@canonical.com>
22+Date: Wed, 18 Nov 2015 01:48:45 -0500
23+Subject: [PATCH] Ensure__repr__ return value is encoded
24+
25+When __repr__ returns an unicode object, python will
26+try to encode it with the default encoding scheme
27+which is ascii in general. So __repr__ needs to make
28+sure its return value is properly encoded.
29+
30+This is actually a backport from oslo.versionedobjects
31+commit f5e792a9833e5139ee1f66b2ac1e55b251c42533
32+
33+Change-Id: I106ebbe97aa531ee48a3534f3837d5936391a2ea
34+Closes-Bug: #1514325
35+---
36+
37+Index: cinder-2015.1.2/cinder/objects/base.py
38+================================================
39+--- cinder-2015.1.2.orig/cinder/objects/base.py
40++++ cinder-2015.1.2./cinder/objects/base.py
41+@@ -24,6 +24,7 @@
42+ import netaddr
43+ from oslo_log import log as logging
44+ import oslo_messaging as messaging
45++from oslo_utils import encodeutils
46+ from oslo_utils import timeutils
47+ import six
48+
49+@@ -276,13 +277,16 @@
50+ setattr(self, key, kwargs[key])
51+
52+ def __repr__(self):
53+- return '%s(%s)' % (
54++ repr_str = '%s(%s)' % (
55+ self.obj_name(),
56+ ','.join(['%s=%s' % (name,
57+ (self.obj_attr_is_set(name) and
58+ field.stringify(getattr(self, name)) or
59+ '<?>'))
60+ for name, field in sorted(self.fields.items())]))
61++ if not six.PY3:
62++ repr_str = encodeutils.safe_encode(repr_str, incoming='utf-8')
63++ return repr_str
64+
65+ @classmethod
66+ def obj_name(cls):
67
68=== modified file 'debian/patches/series'
69--- debian/patches/series 2015-03-23 11:35:50 +0000
70+++ debian/patches/series 2015-12-25 06:33:38 +0000
71@@ -2,3 +2,4 @@
72 fix-requirements.patch
73 fix-long-casting.patch
74 fix-assert-raises-regex-tests.patch
75+encode-repr-return.patch

Subscribers

People subscribed via source and target branches