mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 01:03:09 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user