[PATCH rhel7-branch] Set ONBOOT=yes for devices activated in installer (rhel policy) (#913850)

Radek Vykydal rvykydal at redhat.com
Tue Feb 26 13:22:51 UTC 2013


This is additional patch for rhel that fixes change of behaviour caused by
previous fix for #905918.

The fix from the 905918 deactivates default auto connections and sets ONBOOT=no
at the beginning of the install.
This additional patch deals with the case when auto connection is activated
later (in UI) but ONBOOT value is kept to "no" which is not in accord with our
present rhel policy to autoactivate (after reboot) devices activated during
installation.

---
 pyanaconda/installclasses/rhel.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
index d5b000e..8670106 100644
--- a/pyanaconda/installclasses/rhel.py
+++ b/pyanaconda/installclasses/rhel.py
@@ -20,6 +20,9 @@
 from pyanaconda.installclass import BaseInstallClass
 from pyanaconda.constants import *
 from pyanaconda.product import *
+from pyanaconda import network
+from pyanaconda import isys
+
 import types
 
 class InstallClass(BaseInstallClass):
@@ -98,5 +101,18 @@ class InstallClass(BaseInstallClass):
 
         return oldMajor == newMajor
 
+    def setNetworkOnbootDefault(self, ksdata):
+        for devName in network.getActiveNetDevs():
+            if isys.isWirelessDevice(devName):
+                continue
+            dev = network.NetworkDevice(ROOT_PATH + network.netscriptsDir, devName)
+            dev.loadIfcfgFile()
+            dev.set(('ONBOOT', 'yes'))
+            dev.writeIfcfgFile()
+            for nd in ksdata.network.network:
+                if nd.device == dev.iface:
+                    nd.onboot = True
+                    break
+
     def __init__(self):
         BaseInstallClass.__init__(self)
-- 
1.7.11.7



More information about the anaconda-patches mailing list