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:
parent
5e18bc5955
commit
5dd2aad535
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue