diff options
author | Gonéri Le Bouder <goneri@lebouder.net> | 2022-01-04 15:04:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 14:04:09 -0600 |
commit | fef532d7d6e8932b1b91eb0fc811335d55a79257 (patch) | |
tree | 11020f3fc0cbf3459a8b57e123bdf2f2896a329b /cloudinit/net | |
parent | 2fd80c633d09717b4d669848b814848748e91470 (diff) | |
download | vyos-cloud-init-fef532d7d6e8932b1b91eb0fc811335d55a79257.tar.gz vyos-cloud-init-fef532d7d6e8932b1b91eb0fc811335d55a79257.zip |
bsd/resolv.d/ avoid duplicated entries (#1163)
Ensure we don't add duplicated nameserver or searchdomains.
This can happen on OpenBSD because of dhcpleased.
Diffstat (limited to 'cloudinit/net')
-rw-r--r-- | cloudinit/net/bsd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/net/bsd.py b/cloudinit/net/bsd.py index dc322582..ff5c7413 100644 --- a/cloudinit/net/bsd.py +++ b/cloudinit/net/bsd.py @@ -138,14 +138,14 @@ class BSDRenderer(renderer.Renderer): resolvconf.parse() # Add some nameservers - for server in nameservers: + for server in set(nameservers): try: resolvconf.add_nameserver(server) except ValueError: util.logexc(LOG, "Failed to add nameserver %s", server) # And add any searchdomains. - for domain in searchdomains: + for domain in set(searchdomains): try: resolvconf.add_search_domain(domain) except ValueError: |