Skip to content
Snippets Groups Projects
Commit 08ab7b61 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

test dns: use of nmcli instead of greping NM conn dir

parent 5ce5673e
No related branches found
No related tags found
No related merge requests found
......@@ -24,11 +24,12 @@ def get_dns_servers():
servers.append(l.split('nameserver ')[1])
if servers == ['127.0.1.1']:
# NetworkManager
status, output = subprocess.getstatusoutput('grep -R "dns=" /etc/NetworkManager/system-connections')
status, output = subprocess.getstatusoutput('nmcli -f all device show | grep IP4.DNS | awk \'{ print $2 }\'')
for l in output.split('\n'):
servers.extend(l.split('dns=')[1].rstrip(';').split(';'))
servers.append(l)
return servers
resolvers = get_dns_servers()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment