Downgrade log message for http request failures

Downgrades the log message when an http request fails from error
to debug. The logging level changed in the http.py upgrade in
I09f70eee3e2777f52ce040296015d41649c2586a which effectively reverted
a similar fix commited in I6d0efb53d1e81adf309f7fa580ec5a8073a811c5.

We don't want to log at ERROR level because we already have an
exception raised and the caller can handle it if wants
to. However this error will appear regularly in the Nova logs
under normal behavior (say a client specifies an image which does
not exist) and there is no way of disabling only the glanceclient
error log. This results in a lot of noise in the nova log file.

Change-Id: Iec13bff439073a79cb24e9b22fd43603ae4e61b7
This commit is contained in:
Chris Yeoh
2014-08-01 16:14:05 +09:30
parent 68c1d1fbc6
commit cda8c4d6cf

View File

@@ -195,7 +195,7 @@ class HTTPClient(object):
raise exc.CommunicationError(message=message)
if not resp.ok:
LOG.error("Request returned failure status %s." % resp.status_code)
LOG.debug("Request returned failure status %s." % resp.status_code)
raise exc.from_response(resp, resp.content)
elif resp.status_code == requests.codes.MULTIPLE_CHOICES:
raise exc.from_response(resp)