From bc990004e1252395f5358946316a73064d7a8fd2 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 5 Apr 2017 18:40:29 -0400 Subject: [PATCH] fix hashing when path is symlink (cherry picked from commit 631a10745d344c85817ab504f678d2c40ec8ae4b) --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 3327d1b2e2..de9d194d79 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -2024,7 +2024,7 @@ class AnsibleModule(object): (filename, algorithm, ', '.join(AVAILABLE_HASH_ALGORITHMS))) blocksize = 64 * 1024 - infile = open(filename, 'rb') + infile = open(os.path.realpath(filename), 'rb') block = infile.read(blocksize) while block: digest_method.update(block)