diff options
author | David Stanek <dstanek@dstanek.com> | 2016-06-15 12:51:04 +0000 |
---|---|---|
committer | dineshbhor <dinesh.bhor@nttdata.com> | 2018-03-26 01:51:30 -0700 |
commit | b2e9caee38ca66147552a8f677468becf812e16e (patch) | |
tree | ee6d38ec886efb8da04664ab822d501cf57ff559 /keystoneclient/httpclient.py | |
parent | 70f33b5e226e9b945cea66bfa774934537f04841 (diff) | |
download | python-keystoneclient-b2e9caee38ca66147552a8f677468becf812e16e.tar.gz |
Add Response class to return request-id to caller
This change is required to return 'request_id' from client
to log request_id mappings of cross-project requests.
Instantiating class 'keystoneclient.v3.client.Client' using
'include_metadata=True' will cause manager response to return
a new 'Response' class instead of just the data. This 'Response'
class is going to have additional metadata properties available
like 'request_ids' and the original data will be available as
property 'data' to it.
This change is backward compatible since user has to set a new
parameter 'include_metadata=True' to client in order to get the
request_id returned.
Co-author: Dinesh Bhor <dinesh.bhor@nttdata.com>
Partially Implements: blueprint return-request-id-to-caller
Change-Id: Ibefaa484158ff08bfcacc1e2802d87fc26fd76a5
Diffstat (limited to 'keystoneclient/httpclient.py')
-rw-r--r-- | keystoneclient/httpclient.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py index 50d393a..8d157ce 100644 --- a/keystoneclient/httpclient.py +++ b/keystoneclient/httpclient.py @@ -389,6 +389,11 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin): user_agent=user_agent, connect_retries=connect_retries) + # NOTE(dstanek): This allows me to not have to change keystoneauth or + # to write an adapter to the adapter here. Splitting thing into + # multiple project isn't always all sunshine and roses. + self._adapter.include_metadata = kwargs.pop('include_metadata', False) + # keyring setup if use_keyring and keyring is None: _logger.warning('Failed to load keyring modules.') |