From 1d0cb6812bea8f72235db927c598633d6bf97162 Mon Sep 17 00:00:00 2001 From: Stuart McLaren Date: Mon, 14 Mar 2016 14:28:42 +0000 Subject: [PATCH] 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 --- keystoneclient/auth/identity/v3/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keystoneclient/auth/identity/v3/base.py b/keystoneclient/auth/identity/v3/base.py index 510fa66e2..d82c28953 100644 --- a/keystoneclient/auth/identity/v3/base.py +++ b/keystoneclient/auth/identity/v3/base.py @@ -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)