anaconda: write minimal network configuration

Do not skip it completely, only remove network devices setup.
Especially set hostname.
This commit is contained in:
Marek Marczykowski 2013-02-08 00:59:56 +01:00
parent 51bb3df5ff
commit 1c0f105c44
2 changed files with 3 additions and 31 deletions

View File

@ -67,9 +67,9 @@ def doConfiguration(storage, payload, ksdata, instClass):
ksdata.firewall.execute(storage, ksdata, instClass)
ksdata.xconfig.execute(storage, ksdata, instClass)
#if not flags.flags.imageInstall:
# with progress_report(_("Writing network configuration")):
# ksdata.network.execute(storage, ksdata, instClass)
if not flags.flags.imageInstall:
with progress_report(_("Writing network configuration")):
ksdata.network.execute(storage, ksdata, instClass)
# Creating users and groups requires some pre-configuration.
with progress_report(_("Creating users")):

View File

@ -831,29 +831,7 @@ def write_sysconfig_network(rootpath, ksdata, overwrite=False):
f = open(cfgfile, "w")
f.write("# Generated by anaconda\n")
f.write("NETWORKING=no\n")
gateway = ipv6_defaultgw = None
for iface in reversed(getDevices()):
if isys.isWirelessDevice(iface):
continue
dev = NetworkDevice(netscriptsDir, iface)
dev.loadIfcfgFile()
if dev.get('DEFROUTE') != "no":
continue
if dev.get('GATEWAY'):
gateway = dev.get('GATEWAY')
if dev.get('IPV6_DEFAULTGW'):
ipv6_defaultgw = dev.get('IPV6_DEFAULTGW')
if gateway and ipv6_defaultgw:
break
if gateway:
f.write("GATEWAY=%s\n" % gateway)
if ipv6_defaultgw:
f.write("IPV6_DEFAULTGW=%s\n" % ipv6_defaultgw)
f.close()
return True
def disableIPV6(rootpath):
@ -932,12 +910,6 @@ def write_network_config(storage, ksdata, instClass, rootpath):
copyIfcfgFiles(rootpath)
copyDhclientConfFiles(rootpath)
copyFileToPath("/etc/resolv.conf", rootpath, overwrite=flags.livecdInstall)
# TODO the default for ONBOOT needs to be lay down
# before newui we didn't set it for kickstart installs
instClass.setNetworkOnbootDefault(ksdata)
# NM_CONTROLLED is not mirrored in ksdata
disableNMForStorageDevices(rootpath, storage)
autostartFCoEDevices(rootpath, storage, ksdata)
def wait_for_dhcp():
"""If NM is in connecting state, wait for connection.