mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix get_dns_facts on inexistent resolv.conf
This commit is contained in:
@@ -727,7 +727,7 @@ class Facts(object):
|
|||||||
|
|
||||||
def get_dns_facts(self):
|
def get_dns_facts(self):
|
||||||
self.facts['dns'] = {}
|
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() == '':
|
if line.startswith('#') or line.startswith(';') or line.strip() == '':
|
||||||
continue
|
continue
|
||||||
tokens = line.split()
|
tokens = line.split()
|
||||||
|
|||||||
Reference in New Issue
Block a user