From 8104ff488bf74dea82b4de4e88563c6b9e1299f3 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 10 Sep 2015 14:11:44 +0200 Subject: [PATCH] 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 --- zaqarclient/queues/v1/flavor.py | 1 + zaqarclient/queues/v1/pool.py | 1 + 2 files changed, 2 insertions(+) diff --git a/zaqarclient/queues/v1/flavor.py b/zaqarclient/queues/v1/flavor.py index 32588ce3..2644d54f 100644 --- a/zaqarclient/queues/v1/flavor.py +++ b/zaqarclient/queues/v1/flavor.py @@ -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): diff --git a/zaqarclient/queues/v1/pool.py b/zaqarclient/queues/v1/pool.py index 879271c0..88f4416d 100644 --- a/zaqarclient/queues/v1/pool.py +++ b/zaqarclient/queues/v1/pool.py @@ -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):