Merge lp:~corey.bryant/cinder/2014.1.4 into lp:~ubuntu-server-dev/cinder/icehouse

Proposed by Corey Bryant
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~corey.bryant/cinder/2014.1.4
Merge into: lp:~ubuntu-server-dev/cinder/icehouse
Diff against target: 159 lines (+136/-0)
4 files modified
debian/changelog (+8/-0)
debian/patches/ignore-http-proxy-during-test.patch (+79/-0)
debian/patches/pep-0476.patch (+47/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~corey.bryant/cinder/2014.1.4
Reviewer Review Type Date Requested Status
Ubuntu Server Developers Pending
Review via email: mp+253665@code.launchpad.net
To post a comment you must log in.
lp:~corey.bryant/cinder/2014.1.4 updated
187. By Corey Bryant

* Support new version of Python 2.7 (LP: #1434575):
  - d/p/pep-0476.patch: PEP 476 updates.
  - d/p/ignore-http-proxy-during-test.patch: PEP 476 updates.

Revision history for this message
Martin Pitt (pitti) wrote :

This looks obsolete.

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-03-19 08:54:59 +0000
3+++ debian/changelog 2015-03-20 15:45:25 +0000
4@@ -1,3 +1,11 @@
5+cinder (1:2014.1.4-0ubuntu1.1) UNRELEASED; urgency=medium
6+
7+ * Support new version of Python 2.7 (LP: #1434575):
8+ - d/p/pep-0476.patch: PEP 476 updates.
9+ - d/p/ignore-http-proxy-during-test.patch: PEP 476 updates.
10+
11+ -- Corey Bryant <corey.bryant@canonical.com> Fri, 20 Mar 2015 08:50:38 -0400
12+
13 cinder (1:2014.1.4-0ubuntu1) trusty; urgency=medium
14
15 * Resynchronize with stable/icehouse (93de51d) (LP: #1432608):
16
17=== added file 'debian/patches/ignore-http-proxy-during-test.patch'
18--- debian/patches/ignore-http-proxy-during-test.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/ignore-http-proxy-during-test.patch 2015-03-20 15:45:25 +0000
20@@ -0,0 +1,79 @@
21+Description: Ignore HTTP_PROXY during test requests
22+Author: Angus Lees <gus@inodes.org>
23+Forwarded: https://review.openstack.org/#/c/166268
24+
25+urllib2 follows http_proxy/HTTP_PROXY by default. If a (non-local)
26+proxy is set and a test tries to connect to localhost:$port, it will
27+instead attempt to connect to $port on the proxy and (presumably) fail.
28+
29+This change forces the two tests that failed in the presence of
30+HTTP_PROXY to connect directly.
31+
32+Change-Id: Ia12c91b356f0ccebf874933ff459aa2faa190655
33+---
34+ cinder/tests/integrated/integrated_helpers.py | 5 +++++
35+ cinder/tests/test_wsgi.py | 11 ++++++++---
36+ 2 files changed, 13 insertions(+), 3 deletions(-)
37+
38+--- a/cinder/tests/integrated/integrated_helpers.py
39++++ b/cinder/tests/integrated/integrated_helpers.py
40+@@ -21,6 +21,8 @@
41+ import string
42+ import uuid
43+
44++import fixtures
45++
46+ from cinder.openstack.common import log as logging
47+ from cinder import service
48+ from cinder import test # For the flags
49+@@ -62,6 +64,9 @@
50+ self.flags(**f)
51+ self.flags(verbose=True)
52+
53++ for var in ('http_proxy', 'HTTP_PROXY'):
54++ self.useFixture(fixtures.EnvironmentVariable(var))
55++
56+ # set up services
57+ self.volume = self.start_service('volume')
58+ self.scheduler = self.start_service('scheduler')
59+--- a/cinder/tests/test_wsgi.py
60++++ b/cinder/tests/test_wsgi.py
61+@@ -37,6 +37,11 @@
62+ 'var'))
63+
64+
65++def open_no_proxy(*args, **kwargs):
66++ opener = urllib2.build_opener(urllib2.ProxyHandler({}))
67++ return opener.open(*args, **kwargs)
68++
69++
70+ class TestLoaderNothingExists(test.TestCase):
71+ """Loader tests where os.path.exists always returns False."""
72+
73+@@ -142,7 +147,7 @@
74+ server = cinder.wsgi.Server("test_app", hello_world)
75+ server.start()
76+
77+- response = urllib2.urlopen('http://127.0.0.1:%d/' % server.port)
78++ response = open_no_proxy('http://127.0.0.1:%d/' % server.port)
79+ self.assertEqual(greetings, response.read())
80+
81+ server.stop()
82+@@ -162,7 +167,7 @@
83+ server = cinder.wsgi.Server("test_app", hello_world)
84+ server.start()
85+
86+- response = urllib2.urlopen('https://127.0.0.1:%d/' % server.port)
87++ response = open_no_proxy('https://127.0.0.1:%d/' % server.port)
88+ self.assertEqual(greetings, response.read())
89+
90+ server.stop()
91+@@ -187,7 +192,7 @@
92+ port=0)
93+ server.start()
94+
95+- response = urllib2.urlopen('https://[::1]:%d/' % server.port)
96++ response = open_no_proxy('https://[::1]:%d/' % server.port)
97+ self.assertEqual(greetings, response.read())
98+
99+ server.stop()
100
101=== added file 'debian/patches/pep-0476.patch'
102--- debian/patches/pep-0476.patch 1970-01-01 00:00:00 +0000
103+++ debian/patches/pep-0476.patch 2015-03-20 15:45:25 +0000
104@@ -0,0 +1,47 @@
105+Description: Deal with PEP-0476 certificate chaining checking
106+Author: Corey Bryant <corey.bryant@canonical.com>
107+Forwarded: https://review.openstack.org/#/c/166263
108+
109+PEP-0476 introduced more thorough certificate chain verfication
110+for HTTPS connectivity; this was introduced in Python 2.7.9, and
111+breaks a number of unit tests in the cinder codebase.
112+
113+Disable certificate chain verification for cinder SSL tests
114+using the backwards compatible SSLContext provided for this
115+purpose.
116+
117+Change-Id: Iffc3658196f608c7a7c9b6527dc8e7210fb05bff
118+Closes-Bug: #1403068
119+---
120+ cinder/tests/test_wsgi.py | 13 ++++++++++++-
121+ 1 file changed, 12 insertions(+), 1 deletion(-)
122+
123+--- a/cinder/tests/test_wsgi.py
124++++ b/cinder/tests/test_wsgi.py
125+@@ -18,6 +18,7 @@
126+
127+ import mock
128+ import os.path
129++import ssl
130+ import tempfile
131+ import urllib2
132+
133+@@ -38,7 +39,17 @@
134+
135+
136+ def open_no_proxy(*args, **kwargs):
137+- opener = urllib2.build_opener(urllib2.ProxyHandler({}))
138++ # NOTE(coreycb):
139++ # Deal with more secure certification chain verficiation
140++ # introduced in python 2.7.9 under PEP-0476
141++ # https://github.com/python/peps/blob/master/pep-0476.txt
142++ if hasattr(ssl, "_create_unverified_context"):
143++ opener = urllib2.build_opener(
144++ urllib2.ProxyHandler({}),
145++ urllib2.HTTPSHandler(context=ssl._create_unverified_context())
146++ )
147++ else:
148++ opener = urllib2.build_opener(urllib2.ProxyHandler({}))
149+ return opener.open(*args, **kwargs)
150+
151+
152
153=== modified file 'debian/patches/series'
154--- debian/patches/series 2014-03-17 17:37:44 +0000
155+++ debian/patches/series 2015-03-20 15:45:25 +0000
156@@ -1,1 +1,3 @@
157 fix-requirements.patch
158+ignore-http-proxy-during-test.patch
159+pep-0476.patch

Subscribers

People subscribed via source and target branches