From 4af8b5ec3a3b217b458e77a7ed60d63c0e53b0ec Mon Sep 17 00:00:00 2001 From: Mike Fulbright Date: Mon, 25 Aug 2003 21:27:36 +0000 Subject: fix for bug #78627 - enhancements and fixes for ks network directive --- installclass.py | 7 +++++-- kickstart.py | 10 ++++++++-- network.py | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/installclass.py b/installclass.py index dafa29cf4..eab704f98 100644 --- a/installclass.py +++ b/installclass.py @@ -300,7 +300,7 @@ class BaseInstallClass: id.auth.enableCache = enableCache - def setNetwork(self, id, bootProto, ip, netmask, ethtool, device = None): + def setNetwork(self, id, bootProto, ip, netmask, ethtool, device = None, onboot = 1): if bootProto: devices = id.network.available () if (devices and bootProto): @@ -310,7 +310,10 @@ class BaseInstallClass: device = list[0] dev = devices[device] dev.set (("bootproto", bootProto)) - dev.set (("onboot", "yes")) + if onboot: + dev.set (("onboot", "yes")) + else: + dev.set (("onboot", "no")) if bootProto == "static": if (ip): dev.set (("ipaddr", ip)) diff --git a/kickstart.py b/kickstart.py index e1d03def9..9563b5cc9 100644 --- a/kickstart.py +++ b/kickstart.py @@ -420,7 +420,7 @@ class KickstartBase(BaseInstallClass): # nodns is only used by the loader (args, extra) = isys.getopt(args, '', [ 'bootproto=', 'ip=', 'netmask=', 'gateway=', 'nameserver=', - 'nodns', 'device=', 'hostname=', 'ethtool=']) + 'nodns', 'device=', 'hostname=', 'ethtool=', 'onboot=']) bootProto = "dhcp" ip = None netmask = "" @@ -428,6 +428,7 @@ class KickstartBase(BaseInstallClass): nameserver = "" hostname = "" ethtool = "" + onboot = 1 device = None for n in args: (str, arg) = n @@ -447,8 +448,13 @@ class KickstartBase(BaseInstallClass): hostname = arg elif str== "--ethtool": ethtool = arg + elif str== "--onboot": + if arg == 'no': + onboot = 0 + else: + onboot = 1 - self.setNetwork(id, bootProto, ip, netmask, ethtool, device=device) + self.setNetwork(id, bootProto, ip, netmask, ethtool, device=device, onboot=onboot) if hostname != "": self.setHostname(id, hostname) if nameserver != "": diff --git a/network.py b/network.py index 1596ef45e..1d0de99e1 100644 --- a/network.py +++ b/network.py @@ -336,6 +336,9 @@ class Network: if dev.get('bootproto') == 'dhcp' or dev.get('ipaddr'): f.write("network --device %s" % dev.get('device')) + onboot = dev.get("onboot") + if onboot and onboot == "no": + f.write(" --onboot no") if dev.get('bootproto') == 'dhcp': f.write(" --bootproto dhcp") if self.overrideDHCPhostname: -- cgit