mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Refactoring for easier to read
This commit is contained in:
parent
7cafbb5f05
commit
be9cddbddf
1 changed files with 1 additions and 3 deletions
|
@ -302,9 +302,7 @@ def is_walrus(s3_url):
|
||||||
def get_md5_digest(local_file):
|
def get_md5_digest(local_file):
|
||||||
md5 = hashlib.md5()
|
md5 = hashlib.md5()
|
||||||
with open(local_file, 'rb') as f:
|
with open(local_file, 'rb') as f:
|
||||||
while True:
|
for data in f.read(1024 ** 2):
|
||||||
data = f.read(1024 ** 2)
|
|
||||||
if not data: break
|
|
||||||
md5.update(data)
|
md5.update(data)
|
||||||
return md5.hexdigest()
|
return md5.hexdigest()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue