diff --git a/tests/test_dns_records.py b/tests/test_dns_records.py index 8dd54cb9a1c58f75ca1ede3dc747e9d996d62636..484bad6452b0feabc5e7aedebe0fc34efac6eb4c 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()