From: Daniel Hokka Zakrisson Date: Sat, 30 Jan 2010 03:43:20 +0000 (+0000) Subject: Only set DNS1 and DNS2 for the primary network, if they exist. X-Git-Tag: pyplnet-4.3-5~3 X-Git-Url: http://git.onelab.eu/?p=pyplnet.git;a=commitdiff_plain;h=ff4f3eff4f870d1d26f5c7f14f45bbcef08e6340 Only set DNS1 and DNS2 for the primary network, if they exist. --- diff --git a/plnet.py b/plnet.py index a94236e..abfeb37 100755 --- 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"