fix the glance client not refresh token issue

glance client is not refreshing the keystone token after expiration with
it's commit:
dbb242b776,
we need to patch this in our glance client to refresh the auth_token in
it's session head.

Closes-Bug: #1370402
Change-Id: I9c7a6620a587e855d7f9df8ad83450489daa8247
This commit is contained in:
Terry Yao 2014-09-17 17:09:23 +08:00
parent 78bf927a6a
commit 2b714e12e5
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ def patch_client(service_wrapper, client):
def _patched_http_request(url, method, **kwargs):
# patch glance HTTPClient to use our keystone for tokens
http_client.auth_token = service_wrapper.keystone.auth_token
http_client.session.headers["X-Auth-Token"] = http_client.auth_token
if url.startswith('/'):
url = url[1:]
return org_http_request(method, url, **kwargs)