[anaconda 4/6] Skip networkInitialize for image and dir installations

Brian C. Lane bcl at redhat.com
Wed Aug 6 19:22:58 UTC 2014


Assume that the network has been setup by the host system which could be
a desktop, a minimal system or a mock chroot.
---
 pyanaconda/network.py | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 9d589bd..77bbd9c 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -1140,30 +1140,32 @@ def apply_kickstart(ksdata):
     return applied_devices
 
 def networkInitialize(ksdata):
+    if flags.imageInstall or flags.dirInstall:
+        log.info("Skipping networkInitialize for image/dir installation")
+        return
 
     log.debug("network: devices found %s", nm.nm_devices())
     logIfcfgFiles("network initialization")
 
-    if not flags.imageInstall and not flags.dirInstall:
-        devnames = apply_kickstart(ksdata)
-        if devnames:
-            msg = "kickstart pre section applied for devices %s" % devnames
-            log.debug("network: %s", msg)
-            logIfcfgFiles(msg)
-        devnames = dumpMissingDefaultIfcfgs()
-        if devnames:
-            msg = "missing ifcfgs created for devices %s" % devnames
-            log.debug("network: %s", msg)
-            logIfcfgFiles(msg)
-
-        # For kickstart network --activate option we set ONBOOT=yes
-        # in dracut to get devices activated by NM. The real network --onboot
-        # value is set here.
-        devnames = setOnboot(ksdata)
-        if devnames:
-            msg = "setting real kickstart ONBOOT value for devices %s" % devnames
-            log.debug("network: %s", msg)
-            logIfcfgFiles(msg)
+    devnames = apply_kickstart(ksdata)
+    if devnames:
+        msg = "kickstart pre section applied for devices %s" % devnames
+        log.debug("network: %s", msg)
+        logIfcfgFiles(msg)
+    devnames = dumpMissingDefaultIfcfgs()
+    if devnames:
+        msg = "missing ifcfgs created for devices %s" % devnames
+        log.debug("network: %s", msg)
+        logIfcfgFiles(msg)
+
+    # For kickstart network --activate option we set ONBOOT=yes
+    # in dracut to get devices activated by NM. The real network --onboot
+    # value is set here.
+    devnames = setOnboot(ksdata)
+    if devnames:
+        msg = "setting real kickstart ONBOOT value for devices %s" % devnames
+        log.debug("network: %s", msg)
+        logIfcfgFiles(msg)
 
     if ksdata.network.hostname is None:
         hostname = getHostname()
-- 
1.9.3



More information about the anaconda-patches mailing list