7c43c8e
Index: cloud-init-0.7.9/cloudinit/distros/parsers/resolv_conf.py
7c43c8e
===================================================================
7c43c8e
--- cloud-init-0.7.9.orig/cloudinit/distros/parsers/resolv_conf.py
7c43c8e
+++ cloud-init-0.7.9/cloudinit/distros/parsers/resolv_conf.py
7c43c8e
@@ -6,9 +6,11 @@
7c43c8e
 
7c43c8e
 from six import StringIO
7c43c8e
 
7c43c8e
+from cloudinit.distros.parsers import chop_comment
7c43c8e
+from cloudinit import log as logging
7c43c8e
 from cloudinit import util
7c43c8e
 
7c43c8e
-from cloudinit.distros.parsers import chop_comment
7c43c8e
+LOG = logging.getLogger(__name__)
7c43c8e
 
7c43c8e
 
7c43c8e
 # See: man resolv.conf
7c43c8e
@@ -79,9 +81,10 @@ class ResolvConf(object):
7c43c8e
         if len(new_ns) == len(current_ns):
7c43c8e
             return current_ns
7c43c8e
         if len(current_ns) >= 3:
7c43c8e
-            # Hard restriction on only 3 name servers
7c43c8e
-            raise ValueError(("Adding %r would go beyond the "
7c43c8e
-                              "'3' maximum name servers") % (ns))
7c43c8e
+            LOG.warn("ignoring nameserver %r: adding would "
7c43c8e
+                     "exceed the maximum of "
7c43c8e
+                     "'3' name servers (see resolv.conf(5))" % (ns))
7c43c8e
+            return current_ns[:3]
7c43c8e
         self._remove_option('nameserver')
7c43c8e
         for n in new_ns:
7c43c8e
             self._contents.append(('option', ['nameserver', n, '']))
7c43c8e
Index: cloud-init-0.7.9/tests/unittests/test_distros/test_resolv.py
7c43c8e
===================================================================
7c43c8e
--- cloud-init-0.7.9.orig/tests/unittests/test_distros/test_resolv.py
7c43c8e
+++ cloud-init-0.7.9/tests/unittests/test_distros/test_resolv.py
7c43c8e
@@ -46,7 +46,7 @@ class TestResolvHelper(TestCase):
7c43c8e
         self.assertNotIn('10.3', rp.nameservers)
7c43c8e
         self.assertEqual(len(rp.nameservers), 3)
7c43c8e
         rp.add_nameserver('10.2')
7c43c8e
-        self.assertRaises(ValueError, rp.add_nameserver, '10.3')
7c43c8e
+        rp.add_nameserver('10.3')
7c43c8e
         self.assertNotIn('10.3', rp.nameservers)
7c43c8e
 
7c43c8e
     def test_search_domains(self):