From 5dd2aad535f8ea24a27df279d596b6c8a0e5d077 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 18 Jan 2016 17:58:45 -0500 Subject: [PATCH] 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 --- lib/ansible/module_utils/facts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index a214b6bb30d..c5dc1f9ac80 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -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