[PATCH] Don't traceback when no activated devices were found for ks network default (#956614)
Radek Vykydal
rvykydal at redhat.com
Thu Apr 25 10:52:14 UTC 2013
Typical crash case:
specify network ks command with --hostname only.
---
pyanaconda/network.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 577d3b0..42a9294 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -810,7 +810,10 @@ def get_device_name(devspec):
elif nm.nm_is_connected():
# device activated in stage 1 by network kickstart command
msg = "first active device"
- devname = nm.nm_activated_devices()[0]
+ try:
+ devname = nm.nm_activated_devices()[0]
+ except IndexError:
+ log.debug("get_device_name: NM is connected but no activated devices found")
else:
msg = "first device found"
devname = min(devices)
@@ -840,7 +843,7 @@ def get_device_name(devspec):
log.error("Using --device=bootif without BOOTIF= boot option supplied")
else: devname = devspec
- if devname not in devices:
+ if devname and devname not in devices:
for d in devices:
try:
hwaddr = nm.nm_device_hwaddress(d)
--
1.7.11.7
More information about the anaconda-patches
mailing list