From 264c22a9cc0955a1d0f545d5bc5de30bdf7b5072 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Mon, 12 Jun 2017 15:10:05 +0900 Subject: [PATCH] Fix setting 'global_request_id' in SessionClient In Ic75be3acb8b77aae8da631e3c4cd6f545a9a35cb, 'global_request_id' is set in the constructor of class keystoneauth1.adaptor.Adapter. But 'global_request_id' was not passed to the constructor, 'global_request_id' was cleared. It caused the test failure. It is not necessary to set 'global_request_id' in the constructor of class SessionClient and just passing 'global_request_id' in kwargs is required. Change-Id: Id587e35c221fe2b11889469f88557d254125ea7e Closes-Bug: #1697358 --- novaclient/client.py | 5 ----- requirements.txt | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/novaclient/client.py b/novaclient/client.py index f65f194f7..2d2716310 100644 --- a/novaclient/client.py +++ b/novaclient/client.py @@ -40,7 +40,6 @@ from novaclient import extension as ext from novaclient.i18n import _ from novaclient import utils -REQ_ID_HEADER = 'X-OpenStack-Request-ID' # TODO(jichenjc): when an extension in contrib is moved to core extension, # Add the name into the following list, then after last patch merged, # remove the whole function @@ -57,16 +56,12 @@ class SessionClient(adapter.LegacyJsonAdapter): self.timings = kwargs.pop('timings', False) self.api_version = kwargs.pop('api_version', None) self.api_version = self.api_version or api_versions.APIVersion() - self.global_request_id = kwargs.pop('global_request_id', None) super(SessionClient, self).__init__(*args, **kwargs) def request(self, url, method, **kwargs): kwargs.setdefault('headers', kwargs.get('headers', {})) api_versions.update_headers(kwargs["headers"], self.api_version) - if self.global_request_id is not None: - kwargs['headers'].setdefault(REQ_ID_HEADER, self.global_request_id) - # NOTE(dbelova): osprofiler_web.get_trace_id_headers does not add any # headers in case if osprofiler is not initialized. if osprofiler_web: diff --git a/requirements.txt b/requirements.txt index 3dc8ecfde..d909bbdb9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 -keystoneauth1>=2.20.0 # Apache-2.0 +keystoneauth1>=2.21.0 # Apache-2.0 iso8601>=0.1.11 # MIT oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0