[PATCH 3/4] Network spoke: set NM_CONTROLLED to yes in initial files

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

 



So that we can control them with the spoke.

We used to do it when initializing network object in stage 2
because of subtleties of network storage devices handling. It seems we
can do it already when writing initial ifcfg files (loader/dracut).
---
 loader/net.c          |    2 +-
 pyanaconda/network.py |   14 --------------
 2 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index d556554..dc11390 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1215,7 +1215,7 @@ int writeDisabledIfcfgFile(char *device) {
     fprintf(fp, "DEVICE=%s\n", device);
     fprintf(fp, "HWADDR=%s\n", iface_mac2str(device));
     fprintf(fp, "ONBOOT=no\n");
-    fprintf(fp, "NM_CONTROLLED=no\n");
+    fprintf(fp, "NM_CONTROLLED=yes\n");
     /* default for network service, NM assumes it */
     fprintf(fp, "BOOTPROTO=dhcp\n");
 
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index f9d50cf..2cfe5c3 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -396,12 +396,6 @@ class Network:
 
         self.update()
 
-        # Set all devices to be controlled by NM by default.
-        # We can filter out storage devices only after
-        # we have device tree populated. So we do it before
-        # running nm-c-e and before writing ifcfg files to system.
-        self.setNMControlledDevices(self.netdevices.keys())
-
     def update(self):
         ifcfglog.debug("Network.update() called")
 
@@ -551,14 +545,6 @@ class Network:
             device.writeIfcfgFile()
 
     # devices == None => set for all
-    def setNMControlledDevices(self, devices=None):
-        for devname, device in self.netdevices.items():
-            if devices and devname not in devices:
-                device.set(('NM_CONTROLLED', 'no'))
-            else:
-                device.set(('NM_CONTROLLED', 'yes'))
-
-    # devices == None => set for all
     def updateActiveDevices(self, devices=None):
         for devname, device in self.netdevices.items():
             if devices and devname not in devices:
-- 
1.7.7.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux