Don't reuse request and transport instances

Re-using these instances was causing request failures when talking to
`uwsgi`. I still don't know the exact cause - probably something related
to the headers or even cached in the `http.Client` instance - but this
does fix the current issue and it also makes sense to have a new request
object for every request.

Change-Id: I30f78e048eea7105e4cced4530b165ad7a25d914
This commit is contained in:
Flavio Percoco 2015-09-10 14:11:44 +02:00
parent bf841b56cf
commit 8104ff488b
2 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ class Flavor(object):
data = {'pool': self.pool,
'capabilities': self.capabilities}
req, trans = self.client._request_and_transport()
core.flavor_create(trans, req, self.name, data)
def update(self, flavor_data):

View File

@ -58,6 +58,7 @@ class Pool(object):
if self.client.api_version >= 1.1:
data['group'] = self.group
req, trans = self.client._request_and_transport()
core.pool_create(trans, req, self.name, data)
def update(self, pool_data):