From f4fd9d366b947ce0c8ea99c7edb7ec862575b161 Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Sun, 22 Jun 2014 04:08:59 +0200 Subject: [PATCH] Check for empty os-release file, fixes #7885 --- lib/ansible/module_utils/facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index a70608db69b..9515bd1fffe 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -266,7 +266,7 @@ class Facts(object): self.facts['distribution_release'] = dist[2] or 'NA' # Try to handle the exceptions now ... for (path, name) in Facts.OSDIST_DICT.items(): - if os.path.exists(path): + if os.path.exists(path) and os.path.getsize(path) > 0: if self.facts['distribution'] == 'Fedora': pass elif name == 'RedHat':