summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Coca <bcoca@ansible.com>2015-11-09 22:10:15 +0100
committerBrian Coca <bcoca@ansible.com>2015-11-09 22:10:15 +0100
commit74d76105aa2b38822dea08f8a244adbfa9608426 (patch)
treea168b79a966a6cb0c326f05e182aa4738b0e6458 /lib
parentMerge pull request #13072 from Yannig/devel_cache_optimization (diff)
parentFix get_dns_facts on inexistent resolv.conf (diff)
downloadansible-74d76105aa2b38822dea08f8a244adbfa9608426.tar.xz
ansible-74d76105aa2b38822dea08f8a244adbfa9608426.zip
Merge pull request #13100 from ghislainbourgeois/patch-2
Fix get_dns_facts on inexistent resolv.conf
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/module_utils/facts.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index bc611b41d0..d7105b5a87 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()