summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Faulkner <jay@jvf.cc>2020-01-07 11:50:43 -0800
committerJay Faulkner <jay@jvf.cc>2020-01-14 15:33:30 +0000
commit946ac3ed2e9e177eb5c56cc74aadbc091b9292ab (patch)
treebccc07a3dc7802c4bedadd947b30282761868999
parenta363edd761e2c99bae6d4492d0ca44a404e5d904 (diff)
downloadpython-neutronclient-946ac3ed2e9e177eb5c56cc74aadbc091b9292ab.tar.gz
Convert exception to string before passing it in7.0.0
Before this change, neutronclient was passing in a raw exception as a kwarg to the ConnectionFailed exception. This caused an exception to be raised in _safe_decode_dict() due to the exception not being a text type. Now, we explicitly convert the raw exception to a string before passing it as a kwarg. Closes-bug: 1859068 Change-Id: I323b3aceec0a937874eabf770fbc82995202f6d6
-rw-r--r--neutronclient/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/neutronclient/client.py b/neutronclient/client.py
index c5f4676..936d297 100644
--- a/neutronclient/client.py
+++ b/neutronclient/client.py
@@ -104,13 +104,13 @@ class HTTPClient(object):
try:
resp, body = self.request(*args, **kargs)
except requests.exceptions.SSLError as e:
- raise exceptions.SslCertificateValidationError(reason=e)
+ raise exceptions.SslCertificateValidationError(reason=str(e))
except Exception as e:
# Wrap the low-level connection error (socket timeout, redirect
# limit, decompression error, etc) into our custom high-level
# connection exception (it is excepted in the upper layers of code)
_logger.debug("throwing ConnectionFailed : %s", e)
- raise exceptions.ConnectionFailed(reason=e)
+ raise exceptions.ConnectionFailed(reason=str(e))
utils.http_log_resp(_logger, resp, body)
# log request-id for each api call