[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Set ONBOOT=yes for FCoE devices (#755147)



Resolves: rhbz#755147
---
 instdata.py |    2 ++
 network.py  |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/instdata.py b/instdata.py
index 9f7c166..c283c26 100644
--- a/instdata.py
+++ b/instdata.py
@@ -162,6 +162,8 @@ class InstallData:
         self.network.copyConfigToPath(instPath=self.anaconda.rootPath)
         self.network.disableNMForStorageDevices(self.anaconda,
                                                 instPath=self.anaconda.rootPath)
+        self.network.autostartFCoEDevices(self.anaconda,
+                                          instPath=self.anaconda.rootPath)
         self.firewall.write (self.anaconda.rootPath)
         self.security.write (self.anaconda.rootPath)
         self.desktop.write(self.anaconda.rootPath)
diff --git a/network.py b/network.py
index b03c755..98dd4af 100644
--- a/network.py
+++ b/network.py
@@ -608,6 +608,20 @@ class Network:
                     log.warning("disableNMForStorageDevices: %s file not found" %
                                 device.path)
 
+    def autostartFCoEDevices(self, anaconda, instPath=''):
+        for devName, device in self.netdevices.items():
+            if device.usedByFCoE(anaconda):
+                dev = NetworkDevice(instPath + netscriptsDir, devName)
+                if os.access(dev.path, os.R_OK):
+                    dev.loadIfcfgFile()
+                    dev.set(('ONBOOT', 'yes'))
+                    dev.writeIfcfgFile()
+                    log.debug("setting ONBOOT=yes for network device %s used by fcoe"
+                              % device.path)
+                else:
+                    log.warning("autoconnectFCoEDevices: %s file not found" %
+                                device.path)
+
     def write(self):
 
         ifcfglog.debug("Network.write() called")
-- 
1.7.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]