summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2017-06-12 15:10:05 +0900
committerSean Dague <sean@dague.net>2017-06-13 12:15:39 -0400
commit264c22a9cc0955a1d0f545d5bc5de30bdf7b5072 (patch)
tree318a69925110c0910ef308ddb57d5721822736d8
parente62d1e50b785118c9cb34d1a98875f1ea191d653 (diff)
downloadpython-novaclient-264c22a9cc0955a1d0f545d5bc5de30bdf7b5072.tar.gz
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
-rw-r--r--novaclient/client.py5
-rw-r--r--requirements.txt2
2 files changed, 1 insertions, 6 deletions
diff --git a/novaclient/client.py b/novaclient/client.py
index f65f194f..2d271631 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 3dc8ecfd..d909bbdb 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