mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
download: support multiple hash algorithm
This commit is contained in:
@@ -272,7 +272,10 @@ def download_hash(only_downloads: [str]) -> None:
|
|||||||
allow_redirects=True)
|
allow_redirects=True)
|
||||||
hash_file.raise_for_status()
|
hash_file.raise_for_status()
|
||||||
if downloads[component].get('binary', False):
|
if downloads[component].get('binary', False):
|
||||||
return hashlib.sha256(hash_file.content).hexdigest()
|
return hashlib.new(
|
||||||
|
downloads[component].get('hashtype', 'sha256'),
|
||||||
|
hash_file.content
|
||||||
|
).hexdigest()
|
||||||
return (hash_file.content.decode().split()[0])
|
return (hash_file.content.decode().split()[0])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user