Only set DNS1 and DNS2 for the primary network, if they exist.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Sat, 30 Jan 2010 03:43:20 +0000 (03:43 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Sat, 30 Jan 2010 03:43:20 +0000 (03:43 +0000)
plnet.py

index a94236e..abfeb37 100755 (executable)
--- a/plnet.py
+++ b/plnet.py
@@ -85,10 +85,12 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa
             inter['BOOTPROTO'] = "static"
             inter['IPADDR'] = network['ip']
             inter['NETMASK'] = network['netmask']
-            inter['DNS1'] = network['dns1']
-            inter['DNS2'] = network['dns2']
             if network['is_primary']:
                 gateway = network['gateway']
+                if network['dns1']:
+                    inter['DNS1'] = network['dns1']
+                if network['dns2']:
+                    inter['DNS2'] = network['dns2']
 
         elif network['method'] == "dhcp":
             inter['BOOTPROTO'] = "dhcp"