keystoneauth/keystoneauth1
Eric Fried df57e0ec3b Add a per-request global_request_id
Adapter.__init__ takes a global_request_id which causes the
X-Openstack-Request-Id header to be set on each request. This is fine if
the Adapter is used for only one "request" (in the sense of e.g. "a
server create" -- see [1]), but is too broad if the Adapter is reused
for multiple requests. For example, Nova's SchedulerReportClient (used
to communicate with Placement) creates a single instance of Adapter for
the life of the process [2][3][4]. Openstack SDK's Proxy objects [5]
endure for the life of a Connection.

So what is needed is a way to manage the X-Openstack-Request-Id header
on a per-request basis.

This commit adds a global_request_id kwarg to
keystoneauth1.session.Session.request, which is the funnel point for all
requests coming through Adapter as well as Session itself. (All the
methods feeding into that one already accept and pass through arbitrary
**kwargs.) If present, the value in the X-Openstack-Request-Id header is
set accordingly. Note that this will *override*
Adapter.global_request_id, which is exactly what we want, as described
above.

[1] http://specs.openstack.org/openstack/oslo-specs/specs/pike/global-req-id.html
[2] bea9058f02/nova/scheduler/client/report.py (L200)
[3] bea9058f02/nova/scheduler/client/report.py (L243)
[4] bea9058f02/nova/utils.py (L1219-L1221)
[5] bf6651f149/openstack/proxy.py (L114)

Change-Id: Ied73320fcd813ae796e40cbdb30717900486b92c
2019-07-11 10:35:44 -05:00
..
access Expose app creds and new attrs in fixtures 2019-02-25 00:35:00 +01:00
exceptions add a handler for unknown HTTP errors 2019-06-04 16:03:33 -04:00
extras Mark SAML loader properties as required 2017-11-29 14:57:38 +11:00
fixture Expose app creds and new attrs in fixtures 2019-02-25 00:35:00 +01:00
hacking Move to the keystoneauth1 namespace 2015-06-25 16:48:54 -07:00
identity Add ability to filter version data by service-type 2018-07-23 18:41:18 -05:00
loading Allow setting retry counts for Adapter via configuration options 2019-06-19 15:24:11 +02:00
tests Add a per-request global_request_id 2019-07-11 10:35:44 -05:00
__init__.py Provide a RFC 7231 compliant user agent string 2015-12-15 16:45:17 -06:00
_fair_semaphore.py Add support for client-side rate limiting 2019-02-28 22:14:24 +00:00
_utils.py Disables TCP_KEEPCNT when using Windows Subsystem for Linux 2016-08-23 03:36:45 +00:00
adapter.py Fix rate semaphore for keystoneclient 2019-03-05 10:00:46 +01:00
discover.py Fix version discovery for clouds with int project_ids 2018-11-30 13:09:32 -06:00
noauth.py Make none auth usable in CLI 2017-10-27 18:46:14 +03:00
plugin.py Protect against endpoint_data not existing 2018-09-11 16:18:40 -06:00
service_token.py Add a service token wrapper 2016-10-11 14:14:40 +11:00
session.py Add a per-request global_request_id 2019-07-11 10:35:44 -05:00
token_endpoint.py Add version discovery support to BaseAuthPlugin 2017-09-06 15:43:30 -05:00