Better handling of stale tokens (no more 401's)

There was a problem with stale tokens generating 401's. The
headers for the request where not replacing the stale token
with the freshly obtained one. This patch remedies that.

Change-Id: I8e7c7e01fddeec17ad9ff4254b1223820bb8e2b7
This commit is contained in:
SandyWalsh 2012-08-01 13:23:07 -05:00
parent cefd0fc80e
commit f15974b80d

@ -170,6 +170,7 @@ class HTTPClient(httplib2.Http):
except exceptions.Unauthorized, ex:
try:
self.authenticate()
kwargs['headers']['X-Auth-Token'] = self.auth_token
resp, body = self._time_request(self.management_url + url,
method, **kwargs)
return resp, body