[PATCH 3/8] Stop writing /etc/sysconfig/network (#895900)
Radek Vykydal
rvykydal at redhat.com
Tue Jan 29 12:10:43 UTC 2013
We shouldn't set global GATEWAY, IPV6_DEFAULTGW.
HOSTNAME went to /etc/hostname.
Writing NETWORKING=yes unconditionally doesn't make sense.
---
pyanaconda/network.py | 35 -----------------------------------
1 file changed, 35 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 8034965..3c5779f 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -835,40 +835,6 @@ def write_hostname(rootpath, ksdata, overwrite=False):
return True
-def write_sysconfig_network(rootpath, ksdata, overwrite=False):
-
- cfgfile = os.path.normpath(rootpath + networkConfFile)
- if (os.path.isfile(cfgfile) and not overwrite):
- return False
-
- f = open(cfgfile, "w")
- f.write("# Generated by anaconda\n")
- f.write("NETWORKING=yes\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):
cfgfile = os.path.normpath(rootpath + ipv6ConfFile)
if ('noipv6' in flags.cmdline
@@ -940,7 +906,6 @@ def usedByRootOnISCSI(iface, storage):
def write_network_config(storage, ksdata, instClass, rootpath):
write_hostname(rootpath, ksdata, overwrite=flags.livecdInstall)
set_hostname(ksdata.network.hostname)
- write_sysconfig_network(rootpath, ksdata, overwrite=flags.livecdInstall)
disableIPV6(rootpath)
if not flags.imageInstall:
copyIfcfgFiles(rootpath)
--
1.7.11.7
More information about the anaconda-patches
mailing list