diff options
author | rabi <ramishra@redhat.com> | 2018-09-19 12:21:01 +0530 |
---|---|---|
committer | rabi <ramishra@redhat.com> | 2018-09-19 12:21:01 +0530 |
commit | ae21e6b70db8fbe9d2bfa90d1c3bd31135080381 (patch) | |
tree | 18efdda1069732f8213416836b565c4aa31fb8fb /heatclient/common | |
parent | 68d6c6f764fe0969149d4d82c2afa9f244272810 (diff) | |
download | python-heatclient-ae21e6b70db8fbe9d2bfa90d1c3bd31135080381.tar.gz |
Set X-Region-Name in header when using SessionClient
We don't seem to set the header for region name when using session
client. It's used to look for service endpoints in the catalog.
Change-Id: I10cfdfb88b3f09e4ceb69b1020e82c4eba733804
Story: #2003806
Task: 26550
Diffstat (limited to 'heatclient/common')
-rw-r--r-- | heatclient/common/http.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py index bb2f0c1..0894e19 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -358,6 +358,10 @@ def _construct_http_client(endpoint=None, username=None, password=None, if 'interface' not in kwargs and endpoint_type: kwargs['interface'] = endpoint_type + if 'region_name' in kwargs: + kwargs['additional_headers'] = { + 'X-Region-Name': kwargs['region_name']} + return SessionClient(session, auth=auth, **kwargs) else: return HTTPClient(endpoint=endpoint, username=username, |