From 38be1342516aea9a4dfc470b8a077be8de44ea9e Mon Sep 17 00:00:00 2001 From: Nicolas KAROLAK <nicolas@karolak.fr> Date: Tue, 15 Oct 2019 17:07:33 +0000 Subject: [PATCH] fix case when nmcli is present but does not handle dns --- tests/test_dns_records.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_dns_records.py b/tests/test_dns_records.py index 8dd54cb9..484bad64 100755 --- a/tests/test_dns_records.py +++ b/tests/test_dns_records.py @@ -17,13 +17,16 @@ 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( "nmcli -f all device show | grep IP4.DNS | awk '{ print $2 }'" ) servers = output.split("\n") - else: + + if not len(servers): # resolvconf with open("/etc/resolv.conf", "r") as f: d = f.read().strip() -- GitLab