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

fix systemd output parsing

parent aa3587c6
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@ from envsetup import utils as u # noqa: E402
def get_dns_servers() -> set:
servers = list()
if subprocess.getstatusoutput("command -v nmcli")[0] == 0:
# network-manager
_, output = subprocess.getstatusoutput(
......@@ -32,7 +34,7 @@ def get_dns_servers() -> set:
if "127.0.0.53" in servers:
# systemd-resolved
servers = list()
servers.remove("127.0.0.53")
_, output = subprocess.getstatusoutput("systemd-resolve --status")
lines = [l.strip() for l in output.split("\n")]
dns_line = False
......
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