yanger: DHCP: Fix bug when search exist but no nameserver

When running a DHCP test `resolvconf -l` looked like this:
admin@client:~$ resolvconf -l
search example.com # e5
admin@client:~$

This resulted in broken result when reading operational data from
system-state (which used resolvonf -l)
This commit is contained in:
Mattias Walström
2025-04-23 13:45:49 +02:00
parent 44be4e57f0
commit 4ea451362f
+2 -1
View File
@@ -115,7 +115,8 @@ def add_dns(out):
continue
elif line.startswith('search'):
search.extend(line.split()[1:])
parts = line.split('#', 1)
search.extend(parts[0].split()[1:])
insert(out, "infix-system:dns-resolver", "options", options)
insert(out, "infix-system:dns-resolver", "server", servers)