Commit eadcb6a4 authored by Alan Taylor's avatar Alan Taylor

prefer sha256 to sha1

parent 07019143
......@@ -81,7 +81,7 @@ def _nodes_to_assess(node_ips_specified):
returns
nodes_to_benchmark : set of ip addresses in string form
hash_cached : string
the sha1 hash of the FILENAME_BENCHMARK file used to
the sha256 hash of the FILENAME_BENCHMARK file used to
create the benchmark results, read from the benchmark cache
bench_cached : list of tuples (node ip address, benchmark time)
read from the benchmark cache
......@@ -100,7 +100,7 @@ def _nodes_to_assess(node_ips_specified):
elif cache_missing and bench_present:
# benchmark all the nodes given
nodes_to_benchmark = set(node_ips_specified)
hash_cached = hashlib.sha1(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
hash_cached = hashlib.sha256(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
bench_cached = []
elif cache_present and bench_missing:
......@@ -120,7 +120,7 @@ def _nodes_to_assess(node_ips_specified):
nodes_to_benchmark = set(node_ips_specified)
hash_cached, bench_cached = fio.benchmark_cache_read()
nodes_in_cache = {i[0] for i in bench_cached}
hash_current = hashlib.sha1(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
hash_current = hashlib.sha256(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
if hash_cached == hash_current:
nodes_to_benchmark -= nodes_in_cache
......@@ -263,7 +263,7 @@ def display_bench_cache(nodes_specified):
elif cache_present and bench_present:
hash_cached, bench_cached = fio.benchmark_cache_read()
hash_current = hashlib.sha1(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
hash_current = hashlib.sha256(open(ds.FILENAME_BENCHMARK, 'rb').read()).hexdigest()
if hash_cached != hash_current:
print('benchmark cache exists, but is invalid')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment