Allow seeing full token response when debug enabled

In many situations it can be useful to see the full token response.

Print v3 token response when in debug mode. This will allow the
reponse to be seen when '--debug' is specified with the openstack CLI:

 {
     "token": {
         "methods": [
             "password"
         ],
         "roles": [
             {
                 "id": "93bff41cabda4def87cc9d83aaaa7479"
                 "name": "Member"
             },
             .
             .
             .

Change-Id: I9ec39ceed122a79bbaaef429750e1d2e8401297d
Closes-bug: 1556977
This commit is contained in:
Stuart McLaren
2016-03-14 14:28:42 +00:00
parent c2d5fce3fc
commit 1d0cb6812b

View File

@@ -11,6 +11,7 @@
# under the License.
import abc
import json
import logging
from oslo_config import cfg
@@ -190,6 +191,7 @@ class Auth(BaseAuth):
authenticated=False, log=False, **rkwargs)
try:
_logger.debug(json.dumps(resp.json()))
resp_data = resp.json()['token']
except (KeyError, ValueError):
raise exceptions.InvalidResponse(response=resp)