Do not rely on presence of DEVICE setting in ifcfg files.
nm-c-e is not writing it out, and we can stumble over it
in Live CD environment, see bz #648635 for example.
---
pyanaconda/iw/network_gui.py | 2 +-
pyanaconda/network.py | 4 ++--
pyanaconda/textw/netconfig_text.py | 4 ++--
pyanaconda/vnc.py | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
for dev in devices:
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 2c83ffe..8b567d5 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -549,7 +549,7 @@ class Network:
# ipv4 and ipv6
if dev.get("ONBOOT"):
line += " --onboot %s" % dev.get("ONBOOT")
- line += " --device %s" % dev.get("DEVICE")
+ line += " --device %s" % dev.iface
if dev.get('MTU') and dev.get('MTU') != "0":
line += " --mtu=%s" % dev.get('MTU')
@@ -742,7 +742,7 @@ class Network:
addr = dev.get("HWADDR")
if not addr:
continue
- devname = dev.get("DEVICE")
+ devname = dev.iface
basename = devname
while basename != "" and basename[-1] in string.digits:
basename = basename[:-1]
diff --git a/pyanaconda/textw/netconfig_text.py b/pyanaconda/textw/netconfig_text.py
index c05c96c..7a44516 100644
--- a/pyanaconda/textw/netconfig_text.py
+++ b/pyanaconda/textw/netconfig_text.py
@@ -74,7 +74,7 @@ class NetworkConfiguratorText:
# Preselect device set in kickstart
ksdevice = self.anaconda.network.getKSDevice()
if ksdevice:
- ksdevice = ksdevice.get("DEVICE")
+ ksdevice = ksdevice.iface
for devname in devnames:
hwaddr = self.netdevs[devname].get("HWADDR")
@@ -402,7 +402,7 @@ class NetworkConfiguratorText:
if not result:
self.anaconda.intf.messageWindow(_("Network Error"),
_("There was an error configuring "
- "network device %s") % dev.get('DEVICE'))
+ "network device %s") % dev.iface)
dev.set(("ONBOOT", "no"))
return False
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 0e22417..2760dbd 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -108,7 +108,7 @@ class VncServer:
dev = devices[active_devs[0]]