mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +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()
|
data = data.strip()
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
data = default
|
data = default
|
||||||
|
except:
|
||||||
|
# todo: issue warning about unreadable file?
|
||||||
|
pass
|
||||||
finally:
|
finally:
|
||||||
datafile.close()
|
datafile.close()
|
||||||
return data
|
return data
|
||||||
|
|||||||
Reference in New Issue
Block a user