From eb850d7e5bd78047da055ea974732c67f02c231c Mon Sep 17 00:00:00 2001 From: ghislainbourgeois Date: Mon, 9 Nov 2015 15:02:03 -0500 Subject: [PATCH] Fix get_dns_facts on inexistent resolv.conf --- 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 bc611b41d0f..d7105b5a87e 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -727,7 +727,7 @@ class Facts(object): def get_dns_facts(self): self.facts['dns'] = {} - for line in get_file_lines('/etc/resolv.conf'): + for line in get_file_content('/etc/resolv.conf', '').splitlines(): if line.startswith('#') or line.startswith(';') or line.strip() == '': continue tokens = line.split()