summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2017-09-27 22:05:40 +0000
committerTim Burke <tim.burke@gmail.com>2017-09-27 23:49:59 +0000
commit4716d3da1188eb2f2971004461554b05d0061ec6 (patch)
tree229d23b6f22bcac759b753e3fefab902aa17aa47 /bin
parentff23dcdf3aaef63b85ed3e762cecfc9432206fdc (diff)
downloadswift-4716d3da1188eb2f2971004461554b05d0061ec6.tar.gz
swift-account-audit: compare each etag to the hash from container
...rather than only comparing the ETag from the last response over and over again. NB: This tool *does not* like EC data :-( Change-Id: Idd37f94b07f607ab8a404dd986760361c39af029 Closes-Bug: 1266636
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift-account-audit8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/swift-account-audit b/bin/swift-account-audit
index 7e91ae312..48ab82e85 100755
--- a/bin/swift-account-audit
+++ b/bin/swift-account-audit
@@ -108,7 +108,7 @@ class Auditor(object):
consistent = False
print(' MD5 does not match etag for "%s" on %s/%s'
% (path, node['ip'], node['device']))
- etags.append(resp.getheader('ETag'))
+ etags.append((resp.getheader('ETag'), node))
else:
conn = http_connect(node['ip'], node['port'],
node['device'], part, 'HEAD',
@@ -120,7 +120,7 @@ class Auditor(object):
print(' Bad status HEADing object "%s" on %s/%s'
% (path, node['ip'], node['device']))
continue
- etags.append(resp.getheader('ETag'))
+ etags.append((resp.getheader('ETag'), node))
except Exception:
self.object_exceptions += 1
consistent = False
@@ -131,8 +131,8 @@ class Auditor(object):
consistent = False
print(" Failed fo fetch object %s at all!" % path)
elif hash:
- for etag in etags:
- if resp.getheader('ETag').strip('"') != hash:
+ for etag, node in etags:
+ if etag.strip('"') != hash:
consistent = False
self.object_checksum_mismatch += 1
print(' ETag mismatch for "%s" on %s/%s'