mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Merge pull request #6421 from bcoca/stat_noread_nomd5
now stat skips md5 if file isn't readable
This commit is contained in:
@@ -132,8 +132,9 @@ def main():
|
||||
if S_ISLNK(mode):
|
||||
d['lnk_source'] = os.path.realpath(path)
|
||||
|
||||
if S_ISREG(mode) and get_md5:
|
||||
d['md5'] = module.md5(path)
|
||||
if S_ISREG(mode) and get_md5 and os.access(path,os.R_OK):
|
||||
d['md5'] = module.md5(path)
|
||||
|
||||
|
||||
try:
|
||||
pw = pwd.getpwuid(st.st_uid)
|
||||
|
||||
Reference in New Issue
Block a user