diff -Nru python-glanceclient-0.12.0/debian/changelog python-glanceclient-0.12.0/debian/changelog --- python-glanceclient-0.12.0/debian/changelog 2016-11-14 16:52:02.000000000 +0000 +++ python-glanceclient-0.12.0/debian/changelog 2017-01-23 20:58:25.000000000 +0000 @@ -1,3 +1,11 @@ +python-glanceclient (1:0.12.0-0ubuntu1.2) trusty; urgency=medium + + * d/p/Update-HTTPS-certificate-handling-for-pep-0476.patch: Partial + cherry-picks from upstream to update HTTPS certificate handling for + pep-0476 (LP: #1404227). + + -- Corey Bryant Mon, 23 Jan 2017 15:58:25 -0500 + python-glanceclient (1:0.12.0-0ubuntu1.1) trusty; urgency=medium * Expose is base schema property attribute (LP: #1323660) diff -Nru python-glanceclient-0.12.0/debian/patches/series python-glanceclient-0.12.0/debian/patches/series --- python-glanceclient-0.12.0/debian/patches/series 2016-11-14 16:52:02.000000000 +0000 +++ python-glanceclient-0.12.0/debian/patches/series 2017-01-23 20:58:25.000000000 +0000 @@ -1 +1,2 @@ Expose_is_base_schema_property_attribute.patch +Update-HTTPS-certificate-handling-for-pep-0476.patch diff -Nru python-glanceclient-0.12.0/debian/patches/Update-HTTPS-certificate-handling-for-pep-0476.patch python-glanceclient-0.12.0/debian/patches/Update-HTTPS-certificate-handling-for-pep-0476.patch --- python-glanceclient-0.12.0/debian/patches/Update-HTTPS-certificate-handling-for-pep-0476.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-glanceclient-0.12.0/debian/patches/Update-HTTPS-certificate-handling-for-pep-0476.patch 2017-01-23 20:58:25.000000000 +0000 @@ -0,0 +1,83 @@ +Description: Update HTTPS certificate handling for pep-0476 + This pep (included in python 2.7.9) changes the behaviour of SSL + certificate chain handling to be more py3 like. + + Include required new exception behaviour in the list of + exceptions to translate under py2. + + https://github.com/python/peps/blob/master/pep-0476.txt + + This is a partial cherry pick from the following upstream commits: + 628c541a693ce39a524191250f93c967aef0dba5 + b96f6130265797489e684a4bc123a7a1f5118d2c +Origin: Upstream +Bug-Ubuntu: 1404227 + +--- a/glanceclient/common/http.py ++++ b/glanceclient/common/http.py +@@ -18,9 +18,11 @@ + import hashlib + import logging + import posixpath ++import six + import socket + import StringIO + import struct ++import ssl + import urlparse + + from six.moves import http_client +@@ -324,16 +326,24 @@ + def __init__(self, host, port=None, key_file=None, cert_file=None, + cacert=None, timeout=None, insecure=False, + ssl_compression=True): +- HTTPSConnection.__init__(self, host, port, +- key_file=key_file, +- cert_file=cert_file) +- self.key_file = key_file +- self.cert_file = cert_file +- self.timeout = timeout +- self.insecure = insecure +- self.ssl_compression = ssl_compression +- self.cacert = cacert +- self.setcontext() ++ # NOTE(jamespage) ++ # Accomodate changes in behaviour for pep-0467, introduced ++ # in python 2.7.9. ++ # https://github.com/python/peps/blob/master/pep-0476.txt ++ excp_lst = (TypeError, IOError, ssl.SSLError) ++ try: ++ HTTPSConnection.__init__(self, host, port, ++ key_file=key_file, ++ cert_file=cert_file) ++ self.key_file = key_file ++ self.cert_file = cert_file ++ self.timeout = timeout ++ self.insecure = insecure ++ self.ssl_compression = ssl_compression ++ self.cacert = cacert ++ self.setcontext() ++ except excp_lst as e: ++ raise exc.SSLConfigurationError(str(e)) + + @staticmethod + def host_matches_cert(host, x509): +--- a/tests/test_ssl.py ++++ b/tests/test_ssl.py +@@ -66,6 +66,8 @@ + conn = http.VerifiedHTTPSConnection('127.0.0.1', 0, + key_file=key_file, + cacert=cacert) ++ except exc.SSLConfigurationError: ++ pass + except Exception: + self.fail('Failed to init VerifiedHTTPSConnection.') + +@@ -78,6 +80,7 @@ + cacert = os.path.join(TEST_VAR_DIR, 'ca.crt') + try: + conn = http.VerifiedHTTPSConnection('127.0.0.1', 0, ++ key_file=key_file, + cert_file=cert_file, + cacert=cacert) + self.fail('Failed to raise assertion.')