1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ignore exceptions in get_file_contents

it should be common enough to not be able to read files in some jailed/container environments
even though permissions tell us otherwise
This commit is contained in:
Brian Coca 2016-01-18 17:58:45 -05:00
parent 5e18bc5955
commit 5dd2aad535

View file

@ -2987,6 +2987,9 @@ def get_file_content(path, default=None, strip=True):
data = data.strip()
if len(data) == 0:
data = default
except:
# todo: issue warning about unreadable file?
pass
finally:
datafile.close()
return data