summaryrefslogtreecommitdiff
path: root/glanceclient/common/https.py
diff options
context:
space:
mode:
authorStuart McLaren <stuart.mclaren@hp.com>2015-04-10 14:25:28 +0000
committerStuart McLaren <stuart.mclaren@hp.com>2015-04-16 15:05:53 +0000
commitf9a2a12f178504b7ca6b31a3e1784dd5877ee018 (patch)
tree826ee7cbb9372ddf0cc39f516456c51bc8f1cc1e /glanceclient/common/https.py
parente572ec1d1fa26dc9c1978dbdc332c054f307a0de (diff)
downloadpython-glanceclient-f9a2a12f178504b7ca6b31a3e1784dd5877ee018.tar.gz
Fix client when using no ssl compression
Since the release of the 0.16.1 client, using the 'no ssl compression' option, whether on the command line, or via the library -- Nova does this by default -- a stack trace was generated. Closes-bug: 1442664 Related-bug: 1357430 Change-Id: I2b8ddcb0a7ae3cfccdfc20d3ba476f3b4f4ec32d (cherry picked from commit c698b4e3227b4767f042e435423fcc307d7f6d5c)
Diffstat (limited to 'glanceclient/common/https.py')
-rw-r--r--glanceclient/common/https.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/glanceclient/common/https.py b/glanceclient/common/https.py
index e3a4780..51f8f6d 100644
--- a/glanceclient/common/https.py
+++ b/glanceclient/common/https.py
@@ -22,8 +22,11 @@ from requests import adapters
from requests import compat
try:
from requests.packages.urllib3 import connectionpool
+ from requests.packages.urllib3 import poolmanager
except ImportError:
from urllib3 import connectionpool
+ from urllib3 import poolmanager
+
from oslo_utils import encodeutils
import six
@@ -146,6 +149,10 @@ class HTTPSAdapter(adapters.HTTPAdapter):
https pool by setting glanceclient's
one.
"""
+ def __init__(self, *args, **kwargs):
+ classes_by_scheme = poolmanager.pool_classes_by_scheme
+ classes_by_scheme["glance+https"] = HTTPSConnectionPool
+ super(HTTPSAdapter, self).__init__(*args, **kwargs)
def request_url(self, request, proxies):
# NOTE(flaper87): Make sure the url is encoded, otherwise