Report name resolution errors properly
Errors in name resolution have been logged previously with the url path rather than the hostname. That resulted in incorrect errors like: InvalidEndpoint: Error finding address for /v1/images/detail?is_public=none&limit=20: [Errno -2] Name or service not known rather than one mentioning hostname itself. This patch changes the log message to fit the situation. Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
This commit is contained in:
@@ -183,7 +183,8 @@ class HTTPClient(object):
|
||||
conn.request(method, conn_url, **kwargs)
|
||||
resp = conn.getresponse()
|
||||
except socket.gaierror as e:
|
||||
message = "Error finding address for %(url)s: %(e)s" % locals()
|
||||
message = "Error finding address for %s: %s" % (
|
||||
self.endpoint_hostname, e)
|
||||
raise exc.InvalidEndpoint(message=message)
|
||||
except (socket.error, socket.timeout) as e:
|
||||
endpoint = self.endpoint
|
||||
|
||||
Reference in New Issue
Block a user