summaryrefslogtreecommitdiff
path: root/cloudinit/distros/parsers/resolv_conf.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-03 11:52:06 -0400
committerScott Moser <smoser@brickies.net>2017-04-03 11:52:06 -0400
commit3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb (patch)
tree678b118605245e5bb1b218565728270702aba5b4 /cloudinit/distros/parsers/resolv_conf.py
parente018fa910fdf0dbf3aa22e59e935461babd205c4 (diff)
parent61eb03fef92f435434d974fb46439189ef0b5f97 (diff)
downloadvyos-cloud-init-3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb.tar.gz
vyos-cloud-init-3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb.zip
merge from master at 0.7.9-90-g61eb03fe
Diffstat (limited to 'cloudinit/distros/parsers/resolv_conf.py')
-rw-r--r--cloudinit/distros/parsers/resolv_conf.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/cloudinit/distros/parsers/resolv_conf.py b/cloudinit/distros/parsers/resolv_conf.py
index ff6ee307..d1f8a042 100644
--- a/cloudinit/distros/parsers/resolv_conf.py
+++ b/cloudinit/distros/parsers/resolv_conf.py
@@ -6,9 +6,11 @@
from six import StringIO
+from cloudinit.distros.parsers import chop_comment
+from cloudinit import log as logging
from cloudinit import util
-from cloudinit.distros.parsers import chop_comment
+LOG = logging.getLogger(__name__)
# See: man resolv.conf
@@ -79,9 +81,10 @@ class ResolvConf(object):
if len(new_ns) == len(current_ns):
return current_ns
if len(current_ns) >= 3:
- # Hard restriction on only 3 name servers
- raise ValueError(("Adding %r would go beyond the "
- "'3' maximum name servers") % (ns))
+ LOG.warn("ignoring nameserver %r: adding would "
+ "exceed the maximum of "
+ "'3' name servers (see resolv.conf(5))" % (ns))
+ return current_ns[:3]
self._remove_option('nameserver')
for n in new_ns:
self._contents.append(('option', ['nameserver', n, '']))