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>
This commit is contained in:
@@ -19,6 +19,7 @@ import socket
|
|||||||
|
|
||||||
from keystoneauth1 import adapter
|
from keystoneauth1 import adapter
|
||||||
from keystoneauth1 import exceptions as ksa_exc
|
from keystoneauth1 import exceptions as ksa_exc
|
||||||
|
import OpenSSL
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
import requests
|
import requests
|
||||||
@@ -267,6 +268,10 @@ class HTTPClient(_BaseHTTPClient):
|
|||||||
message = ("Error communicating with %(endpoint)s %(e)s" %
|
message = ("Error communicating with %(endpoint)s %(e)s" %
|
||||||
{'endpoint': endpoint, 'e': e})
|
{'endpoint': endpoint, 'e': e})
|
||||||
raise exc.CommunicationError(message=message)
|
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
|
# log request-id for each api call
|
||||||
request_id = resp.headers.get('x-openstack-request-id')
|
request_id = resp.headers.get('x-openstack-request-id')
|
||||||
|
@@ -11,3 +11,4 @@ six>=1.9.0 # MIT
|
|||||||
oslo.utils>=3.20.0 # Apache-2.0
|
oslo.utils>=3.20.0 # Apache-2.0
|
||||||
oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0
|
oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0
|
||||||
wrapt>=1.7.0 # BSD License
|
wrapt>=1.7.0 # BSD License
|
||||||
|
pyOpenSSL>=0.14 # Apache-2.0
|
||||||
|
Reference in New Issue
Block a user