From ff4f3eff4f870d1d26f5c7f14f45bbcef08e6340 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sat, 30 Jan 2010 03:43:20 +0000 Subject: [PATCH] Only set DNS1 and DNS2 for the primary network, if they exist. --- plnet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" -- 2.43.0