diff options
author | Doug Hellmann <doug@doughellmann.com> | 2017-06-23 13:43:29 -0400 |
---|---|---|
committer | Doug Hellmann <doug@doughellmann.com> | 2017-06-28 12:24:48 -0400 |
commit | d6e936cd14f0954751dfc1b754f08deb166a53bf (patch) | |
tree | cf466bb100b5f8a2f1c15c6b29c20a351d216b3d /glanceclient | |
parent | 05453b19b26ca86459fff477e84e1b041e98a520 (diff) | |
download | python-glanceclient-d6e936cd14f0954751dfc1b754f08deb166a53bf.tar.gz |
add explicit dependency on pyopenssl
The library is used in glanceclient/common/https.py and the
documentation build for the API fails without the dependency.
Update the error handling so that when OpenSSL reports an error it is
converted to a client communication error.
Change-Id: I0c0fb3139bb848d0cbaf88ae6a767a730bea74eb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Diffstat (limited to 'glanceclient')
-rw-r--r-- | glanceclient/common/http.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 5b4981e..35ef282 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -19,6 +19,7 @@ import socket from keystoneauth1 import adapter from keystoneauth1 import exceptions as ksa_exc +import OpenSSL from oslo_utils import importutils from oslo_utils import netutils import requests @@ -267,6 +268,10 @@ class HTTPClient(_BaseHTTPClient): message = ("Error communicating with %(endpoint)s %(e)s" % {'endpoint': endpoint, 'e': e}) raise exc.CommunicationError(message=message) + except OpenSSL.SSL.Error as e: + message = ("SSL Error communicating with %(url)s: %(e)s" % + {'url': conn_url, 'e': e}) + raise exc.CommunicationError(message=message) # log request-id for each api call request_id = resp.headers.get('x-openstack-request-id') |