[PATCH rhel6-branch] Don't write HWADDR into ifcfg files (#690589)

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

 



Not needed anymore (udev and biosdevname take care of the naming).
---
 iw/advanced_storage.py  |    3 ++-
 iw/network_gui.py       |    2 +-
 kickstart.py            |    4 ++--
 loader/net.c            |    4 ----
 network.py              |    6 ++----
 textw/add_drive_text.py |    2 +-
 textw/netconfig_text.py |    2 +-
 7 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/iw/advanced_storage.py b/iw/advanced_storage.py
index 391a6f0..799f612 100644
--- a/iw/advanced_storage.py
+++ b/iw/advanced_storage.py
@@ -31,6 +31,7 @@ import partIntfHelpers as pih
 import storage.fcoe
 import storage.iscsi
 import urlgrabber.grabber
+import isys
 
 import logging
 log = logging.getLogger("anaconda")
@@ -338,7 +339,7 @@ def addFcoeDrive(anaconda):
         else:
             desc = "%s" %(dev,)
 
-        mac = netdevs[dev].get("HWADDR")
+        mac = isys.getMacAddress(dev)
         if mac:
             desc = "%s - %s" %(desc, mac)
 
diff --git a/iw/network_gui.py b/iw/network_gui.py
index 702d227..1cbfbc6 100644
--- a/iw/network_gui.py
+++ b/iw/network_gui.py
@@ -167,7 +167,7 @@ def selectInstallNetDeviceDialog(network, devices = None):
         else:
             desc = "%s" %(dev,)
 
-        hwaddr = network.netdevices[dev].get("HWADDR")
+        hwaddr = isys.getMacAddress(dev)
 
         if hwaddr:
             desc = "%s - %s" %(desc, hwaddr,)
diff --git a/kickstart.py b/kickstart.py
index b7ed5c4..c604ff0 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -584,8 +584,8 @@ class NetworkData(commands.network.RHEL6_NetworkData):
         if devices.has_key(device):
             dev = devices[device]
         else:
-            for (key, val) in devices.iteritems():
-                if val.get("HWADDR").lower() == device.lower():
+            for devname in devices:
+                if isys.getMacAddress(devname).lower() == device.lower():
                     dev = val
                     break
 
diff --git a/loader/net.c b/loader/net.c
index 725c160..993f7c5 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1219,7 +1219,6 @@ 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");
 
@@ -1317,9 +1316,6 @@ int writeEnabledNetInfo(iface_t *iface) {
     }
 
     fprintf(fp, "DEVICE=%s\n", iface->device);
-#if !defined(__s390__) && !defined(__s390x__)
-    fprintf(fp, "HWADDR=%s\n", iface_mac2str(iface->device));
-#endif
     fprintf(fp, "ONBOOT=yes\n");
     char *str_type = netArpTypeStr(iface);
     if (str_type) fprintf(fp, "TYPE=%s\n", str_type);
diff --git a/network.py b/network.py
index eaf2f7b..a0be4c5 100644
--- a/network.py
+++ b/network.py
@@ -219,8 +219,6 @@ class NetworkDevice(IfcfgFile):
             keys.insert(0, "DEVICE")
         if "KEY" in keys:
             keys.remove("KEY")
-        if iutil.isS390() and ("HWADDR" in keys):
-            keys.remove("HWADDR")
         # make sure we include autoneg in the ethtool line
         if 'ETHTOOL_OPTS' in keys:
             eopts = self.get('ETHTOOL_OPTS')
@@ -353,7 +351,7 @@ class Network:
             if ksdevice == 'bootif' and flags.cmdline.get("BOOTIF"):
                 bootif_mac = flags.cmdline.get("BOOTIF")[3:].replace("-", ":").upper()
             for dev in self.netdevices:
-                mac = self.netdevices[dev].get('HWADDR').upper()
+                mac = isys.getMacAddress(dev)
                 if ksdevice == 'link' and isys.getLinkStatus(dev):
                     self.ksdevice = dev
                     break
@@ -788,7 +786,7 @@ class Network:
                     netargs += "ip=%s::%s:%s:%s:%s:none" % (dev.get('ipaddr'),
                                gateway, netmask, hostname, nic)
 
-        hwaddr = dev.get("HWADDR")
+        hwaddr = isys.getMacAddress(dev)
         if hwaddr:
             if netargs != "":
                 netargs += " "
diff --git a/textw/add_drive_text.py b/textw/add_drive_text.py
index 546e68d..dfc9291 100644
--- a/textw/add_drive_text.py
+++ b/textw/add_drive_text.py
@@ -370,7 +370,7 @@ class addDriveDialog(object):
 
         interfaceList = Listbox(height=len(devs), scroll=1)
         for dev in devs:
-            hwaddr = netdevs[dev].get("HWADDR")
+            hwaddr = isys.getMacAddress(dev)
             if hwaddr:
                 desc = "%s - %.50s" % (dev, hwaddr)
             else:
diff --git a/textw/netconfig_text.py b/textw/netconfig_text.py
index 4f72a36..220f682 100644
--- a/textw/netconfig_text.py
+++ b/textw/netconfig_text.py
@@ -77,7 +77,7 @@ class NetworkConfiguratorText:
             ksdevice = ksdevice.get("DEVICE")
 
         for devname in devnames:
-            hwaddr = self.netdevs[devname].get("HWADDR")
+            hwaddr = isys.getMacAddress(dev)
 
             if hwaddr:
                 desc = "%s - %.50s" % (devname, hwaddr)
-- 
1.7.4

_______________________________________________
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