summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2019-10-14 11:15:14 -0700
committerTim Burke <tim.burke@gmail.com>2019-10-14 11:21:06 -0700
commit2f4fe56ca484c0efc11736aa323b2e63199e3513 (patch)
tree0b95909da649b53adf7009fd70f2c14b916889a2 /bin
parent29d46ca9f624cde5f452f7f50ed4244be09eb97a (diff)
downloadswift-2f4fe56ca484c0efc11736aa323b2e63199e3513.tar.gz
py3: fix swift-account-audit
Previously, we'd get a KeyError trying to read headers. Change-Id: I5d9f86784a3e39577ab010d29d8d03b26ffda357
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift-account-audit6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/swift-account-audit b/bin/swift-account-audit
index f0ad4e7de..adfaf7178 100755
--- a/bin/swift-account-audit
+++ b/bin/swift-account-audit
@@ -177,7 +177,8 @@ class Auditor(object):
(path, node['ip'], node['device']))
break
if node['id'] not in responses:
- responses[node['id']] = dict(resp.getheaders())
+ responses[node['id']] = {
+ h.lower(): v for h, v in resp.getheaders()}
results = json.loads(resp.read())
except Exception:
self.container_exceptions += 1
@@ -262,7 +263,8 @@ class Auditor(object):
(account, node['ip'], node['device']))
break
if node_id not in responses:
- responses[node_id] = [dict(resp.getheaders()), []]
+ responses[node_id] = [
+ {h.lower(): v for h, v in resp.getheaders()}, []]
responses[node_id][1].extend(results)
if results:
marker = results[-1]['name']