Re: [PATCH] Translate MAC addresses to devices in the second stage, too.

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

 



Ack

On Wed, 30 Jun 2010, Chris Lumens wrote:

Related: rhbz#185522
---
kickstart.py |   15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 503480e..2ef9738 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -565,9 +565,20 @@ class NetworkData(commands.network.F8_NetworkData):
                else:
                    device = self.device

-                try:
+                # If we were given a network device name, grab the device object.
+                # If we were given a MAC address, resolve that to a device name
+                # and then grab the device object.  Otherwise, errors.
+                dev = None
+
+                if devices.has_key(device):
                    dev = devices[device]
-                except KeyError:
+                else:
+                    for d in devices:
+                        if d.get("HWADDR") == device:
+                            dev = d
+                            break
+
+                if not dev:
                    raise KickstartValueError, formatErrorMsg(self.lineno, msg="The provided network interface %s does not exist" % device)

                dev.set (("bootproto", self.bootProto))


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
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