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
This commit is contained in:
Tim Burke 2017-09-27 22:05:40 +00:00
parent ff23dcdf3a
commit 4716d3da11
1 changed files with 4 additions and 4 deletions

View File

@ -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'