Add more debug info for token_client request

Add the request headers and response body to the debug
logs of the token_client request. Request body is omitted because
of security reasons of not revealing passwords in the debug logs.
Also, response body has sufficient information about the type of
the token requested, therefore omitting request headers is ok.

Closes-Bug: #1503751
Change-Id: I830364e1df0e34398039442dc003fe46ca1db3a1
This commit is contained in:
Roxana Gherle
2015-10-07 09:48:56 -07:00
parent e715e8c8cc
commit 3f1645b365
2 changed files with 4 additions and 2 deletions

View File

@@ -84,7 +84,8 @@ class TokenClient(rest_client.RestClient):
resp, resp_body = self.raw_request(url, method,
headers=headers, body=body)
self._log_request(method, url, resp)
self._log_request(method, url, resp, req_headers=headers,
req_body='<omitted>', resp_body=resp_body)
if resp.status in [401, 403]:
resp_body = json.loads(resp_body)

View File

@@ -134,7 +134,8 @@ class V3TokenClient(rest_client.RestClient):
resp, resp_body = self.raw_request(url, method,
headers=headers, body=body)
self._log_request(method, url, resp)
self._log_request(method, url, resp, req_headers=headers,
req_body='<omitted>', resp_body=resp_body)
if resp.status in [401, 403]:
resp_body = json.loads(resp_body)