Bug 558650 - Broken except statement in ksflatten
Summary: Broken except statement in ksflatten
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pykickstart
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-25 22:21 UTC by Jay Greguske
Modified: 2010-04-13 20:51 UTC (History)
2 users (show)

Fixed In Version: pykickstart-1.69-1.fc13
Clone Of:
Environment:
Last Closed: 2010-01-26 14:57:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Trivial except statement fix (796 bytes, patch)
2010-01-25 22:21 UTC, Jay Greguske
no flags Details | Diff

Description Jay Greguske 2010-01-25 22:21:55 UTC
Created attachment 386714 [details]
Trivial except statement fix

Description of problem:

Line 53 of ksflatten is anticipating an IOError with the normal error number and message set, but this is not the case. On an error condition ksparser.readKickstar() does raise an IOError, but with formatErrorMsg() as its error message so the except statement in ksflatten statement is only going to get one value. Since it is expecting two, the exception handling throws a ValueError exception.

How reproducible:
Always

Steps to Reproduce:
1. Create a kickstart file with a bogus %include statement.
2. Run `ksflatten your-ks-file.ks`
3. Complete the infinite tracklist challenge in Rock Band 2
4. Observe a value error thrown with no useful error message.
  
Actual results:
04:04 PM jgregusk@zyzyx:~/Code $ ksflatten rhevh-jay.ks 
Traceback (most recent call last):
  File "/usr/bin/ksflatten", line 71, in <module>
    main()
  File "/usr/bin/ksflatten", line 53, in main
    except IOError, (err, msg):
ValueError: need more than 1 value to unpack

Expected results:
04:04 PM jgregusk@zyzyx:~/Code $ ksflatten rhevh-jay.ks 
Failed to read kickstart file 'rhevh-jay.ks' : The following problem occurred on line 0 of the kickstart file:

Unable to open input kickstart file: Could not open/read file:///home/jgregusk/Code/whatever.ks

Additional info:
Trivial patch attached.

Comment 1 Chris Lumens 2010-01-26 14:57:09 UTC
Thanks for the patch.

Comment 2 Fedora Update System 2010-03-10 16:03:48 UTC
pykickstart-1.69-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/pykickstart-1.69-1.fc13

Comment 3 Fedora Update System 2010-03-24 00:44:57 UTC
pykickstart-1.69-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Darryl L. Pierce 2010-04-13 14:10:32 UTC
Can we have this fix backported to F12 as well? I'm experiencing the same problem.


Note You need to log in before you can comment on or make changes to this bug.