summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-08-25 21:27:36 +0000
committerMike Fulbright <msf@redhat.com>2003-08-25 21:27:36 +0000
commit4af8b5ec3a3b217b458e77a7ed60d63c0e53b0ec (patch)
tree3f67aa1bb6c40ae05ec661d3f34d69ced8933be3
parent80e8c1224bd65f5b132b9e4fe14506b2ffa09102 (diff)
downloadanaconda-4af8b5ec3a3b217b458e77a7ed60d63c0e53b0ec.tar.gz
anaconda-4af8b5ec3a3b217b458e77a7ed60d63c0e53b0ec.tar.xz
anaconda-4af8b5ec3a3b217b458e77a7ed60d63c0e53b0ec.zip
fix for bug #78627 - enhancements and fixes for ks network directive
-rw-r--r--installclass.py7
-rw-r--r--kickstart.py10
-rw-r--r--network.py3
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: