From be9cddbddf1df6810bb521e05403ae01400e7103 Mon Sep 17 00:00:00 2001 From: "Ching Yi, Chan" Date: Fri, 5 Jun 2015 23:29:11 +0800 Subject: [PATCH] Refactoring for easier to read --- lib/ansible/modules/cloud/amazon/s3.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/s3.py b/lib/ansible/modules/cloud/amazon/s3.py index 01bfcbaf02..ef08a49faf 100644 --- a/lib/ansible/modules/cloud/amazon/s3.py +++ b/lib/ansible/modules/cloud/amazon/s3.py @@ -302,9 +302,7 @@ def is_walrus(s3_url): def get_md5_digest(local_file): md5 = hashlib.md5() with open(local_file, 'rb') as f: - while True: - data = f.read(1024 ** 2) - if not data: break + for data in f.read(1024 ** 2): md5.update(data) return md5.hexdigest()