summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2018-01-17 13:56:13 -0800
committerClay Gerrard <clay.gerrard@gmail.com>2018-01-17 13:56:13 -0800
commit0c27fd2311d512629825eba39868ffc107d2971d (patch)
tree3346fe9989b920426c9e0e1e9acaf40bc0d8a2c7
parente747f94313f315fdf8d8fc01fb0c5aac60c33897 (diff)
downloadswift-0c27fd2311d512629825eba39868ffc107d2971d.tar.gz
Reset state every iteration to avoid stale reference
If you get a valid but unexpected response status you have to continue the loop. If you don't reset resp = None some kinds of exceptions might get re-raised as with the wrong error. Change-Id: I5751dfbc176155bea63103a64fd8d4db62323e60
-rw-r--r--swift/common/internal_client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/swift/common/internal_client.py b/swift/common/internal_client.py
index bba5d209d..6f42c0b29 100644
--- a/swift/common/internal_client.py
+++ b/swift/common/internal_client.py
@@ -179,8 +179,8 @@ class InternalClient(object):
headers = dict(headers)
headers['user-agent'] = self.user_agent
- resp = exc_type = exc_value = exc_traceback = None
for attempt in range(self.request_tries):
+ resp = exc_type = exc_value = exc_traceback = None
req = Request.blank(
path, environ={'REQUEST_METHOD': method}, headers=headers)
if body_file is not None: