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

fix nmcli output split

parent 38be1342
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ def get_dns_servers() -> set: ...@@ -24,7 +24,7 @@ def get_dns_servers() -> set:
_, output = subprocess.getstatusoutput( _, output = subprocess.getstatusoutput(
"nmcli -f all device show | grep IP4.DNS | awk '{ print $2 }'" "nmcli -f all device show | grep IP4.DNS | awk '{ print $2 }'"
) )
servers = output.split("\n") servers = [l for l in output.split("\n") if l]
if not len(servers): if not len(servers):
# resolvconf # resolvconf
......
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