remove explicit global_request_id handling from session client
The neutron client that inherits from keystonauth1 can now use the built in 2.21.0 global_request_id handling. This just cleans up some code in the process. Change-Id: I6df5c98ebf447d3e3783ef23b4ef4d8e8af94c9b
This commit is contained in:
@@ -304,9 +304,6 @@ class HTTPClient(object):
|
|||||||
|
|
||||||
|
|
||||||
class SessionClient(adapter.Adapter):
|
class SessionClient(adapter.Adapter):
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
self.global_request_id = kwargs.pop("global_request_id", None)
|
|
||||||
super(SessionClient, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
def request(self, *args, **kwargs):
|
def request(self, *args, **kwargs):
|
||||||
kwargs.setdefault('authenticated', False)
|
kwargs.setdefault('authenticated', False)
|
||||||
@@ -317,8 +314,6 @@ class SessionClient(adapter.Adapter):
|
|||||||
headers = kwargs.setdefault('headers', {})
|
headers = kwargs.setdefault('headers', {})
|
||||||
headers.setdefault('Accept', content_type)
|
headers.setdefault('Accept', content_type)
|
||||||
|
|
||||||
if self.global_request_id:
|
|
||||||
headers.setdefault(REQ_ID_HEADER, self.global_request_id)
|
|
||||||
# NOTE(dbelova): osprofiler_web.get_trace_id_headers does not add any
|
# NOTE(dbelova): osprofiler_web.get_trace_id_headers does not add any
|
||||||
# headers in case if osprofiler is not initialized.
|
# headers in case if osprofiler is not initialized.
|
||||||
if osprofiler_web:
|
if osprofiler_web:
|
||||||
|
Reference in New Issue
Block a user