summaryrefslogtreecommitdiff
path: root/swiftclient/client.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-19 18:31:15 +0000
committerGerrit Code Review <review@openstack.org>2013-06-19 18:31:15 +0000
commit5d84ff8d9b74997d4494b7bed986f99cfceda9ad (patch)
tree296881d00765eeed2602adb0d60ddc29ac6a1c64 /swiftclient/client.py
parent08e1f09e58eef1f1cb876c6992a9250931988c27 (diff)
parent7b9f304485b990e0b4e3d4373e28b0ac54ea8a0e (diff)
downloadpython-swiftclient-5d84ff8d9b74997d4494b7bed986f99cfceda9ad.tar.gz
Merge "Fixes re-auth flow with expired tokens."
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r--swiftclient/client.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index 04a539c..3d848cd 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -1034,6 +1034,7 @@ class Connection(object):
def _retry(self, reset_func, func, *args, **kwargs):
self.attempts = 0
+ retried_auth = False
backoff = self.starting_backoff
while self.attempts <= self.retries:
self.attempts += 1
@@ -1055,10 +1056,11 @@ class Connection(object):
raise
if err.http_status == 401:
self.url = self.token = None
- if self.attempts > 1 or not all((self.authurl,
- self.user,
- self.key)):
+ if retried_auth or not all((self.authurl,
+ self.user,
+ self.key)):
raise
+ retried_auth = True
elif err.http_status == 408:
self.http_conn = None
elif 500 <= err.http_status <= 599: