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:
@@ -108,7 +108,7 @@ class Auditor(object):
|
|||||||
consistent = False
|
consistent = False
|
||||||
print(' MD5 does not match etag for "%s" on %s/%s'
|
print(' MD5 does not match etag for "%s" on %s/%s'
|
||||||
% (path, node['ip'], node['device']))
|
% (path, node['ip'], node['device']))
|
||||||
etags.append(resp.getheader('ETag'))
|
etags.append((resp.getheader('ETag'), node))
|
||||||
else:
|
else:
|
||||||
conn = http_connect(node['ip'], node['port'],
|
conn = http_connect(node['ip'], node['port'],
|
||||||
node['device'], part, 'HEAD',
|
node['device'], part, 'HEAD',
|
||||||
@@ -120,7 +120,7 @@ class Auditor(object):
|
|||||||
print(' Bad status HEADing object "%s" on %s/%s'
|
print(' Bad status HEADing object "%s" on %s/%s'
|
||||||
% (path, node['ip'], node['device']))
|
% (path, node['ip'], node['device']))
|
||||||
continue
|
continue
|
||||||
etags.append(resp.getheader('ETag'))
|
etags.append((resp.getheader('ETag'), node))
|
||||||
except Exception:
|
except Exception:
|
||||||
self.object_exceptions += 1
|
self.object_exceptions += 1
|
||||||
consistent = False
|
consistent = False
|
||||||
@@ -131,8 +131,8 @@ class Auditor(object):
|
|||||||
consistent = False
|
consistent = False
|
||||||
print(" Failed fo fetch object %s at all!" % path)
|
print(" Failed fo fetch object %s at all!" % path)
|
||||||
elif hash:
|
elif hash:
|
||||||
for etag in etags:
|
for etag, node in etags:
|
||||||
if resp.getheader('ETag').strip('"') != hash:
|
if etag.strip('"') != hash:
|
||||||
consistent = False
|
consistent = False
|
||||||
self.object_checksum_mismatch += 1
|
self.object_checksum_mismatch += 1
|
||||||
print(' ETag mismatch for "%s" on %s/%s'
|
print(' ETag mismatch for "%s" on %s/%s'
|
||||||
|
Reference in New Issue
Block a user