Fix an error on not finding log handler
Magnum client should not log any warning message if there is no logging handler. Otherwise, magnum client will print a confusing message when server return a failure status. Below is the exact message: No handlers could be found for logger "magnumclient.common.httpclient" This message is just a warning that can be safely ignored. In particular, this message does not indicate the root cause of the problem. Users should find the root cause from other places (e.g. the server logs). Change-Id: If6ba4f1bb4900b5632049e8a8a8bfd3b12035f8d
This commit is contained in:
parent
ad0d125575
commit
5b59253667
|
@ -172,7 +172,8 @@ class HTTPClient(object):
|
|||
self.log_http_response(resp)
|
||||
|
||||
if 400 <= resp.status < 600:
|
||||
LOG.warn("Request returned failure status.")
|
||||
if LOG.handlers:
|
||||
LOG.warn("Request returned failure status.")
|
||||
error_json = self._extract_error_json(body_str)
|
||||
raise exceptions.from_response(
|
||||
resp, error_json.get('faultstring'),
|
||||
|
|
Loading…
Reference in New Issue