Bug 191819
Summary: | Seeing "list index out of range" | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Philip Prindeville <philipp> | ||||||
Component: | firstboot | Assignee: | Chris Lumens <clumens> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | |||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 5 | ||||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | i386 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2006-05-16 15:21:00 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Philip Prindeville
2006-05-15 22:42:34 UTC
Created attachment 129135 [details]
Kickstart file from installer DVD
Created attachment 129136 [details]
Modprobe.conf file from target machine
I'm not sure, but I suspect it might be bombing out on the second line, which
is blank, and hence contains no first or second tokens when parsed.
Yes, this is exactly what's going on. The file reading will be more robust in the next build. Dumb question, but... is the fix: --- networking.py.bak 2006-03-03 16:28:01.000000000 -0700 +++ networking.py 2006-05-16 14:20:04.000000000 -0600 @@ -119,7 +119,7 @@ lines = open("/etc/modprobe.conf").readlines() for line in lines: tokens = string.split(line) - if string.strip(tokens[0]) == "alias" and string.strip(tokens[1][:3]) == "eth": + if len(tokens) == 3 and string.strip(tokens[0]) == "alias" and string.strip(tokens[1][:3]) == "eth": module_dict[tokens[1]] = tokens[2] self.deviceStore.clear() That'll work. This is the exact fix: RCS file: /usr/local/CVS/firstboot/src/modules/networking.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- networking.py 19 Jan 2006 19:22:41 -0000 1.27 +++ networking.py 16 May 2006 15:24:51 -0000 1.28 @@ -118,9 +118,19 @@ module_dict = {} lines = open("/etc/modprobe.conf").readlines() for line in lines: + # Skip empty lines and comments. + if line.isspace() or (line != "" and line.lstrip()[0] == '#'): + continue + tokens = string.split(line) - if string.strip(tokens[0]) == "alias" and string.strip(tokens[1][:3]) == "eth": - module_dict[tokens[1]] = tokens[2] + + # If the line isn't formed just like we like it, don't explode. + try: + if string.strip(tokens[0]) == "alias" and \ + string.strip(tokens[1][:3]) == "eth": + module_dict[tokens[1]] = tokens[2] + except IndexError: + pass self.deviceStore.clear() |