Bug 807035 - ResizeError.__init__() takes exactly 2 arguments (3 given)
Summary: ResizeError.__init__() takes exactly 2 arguments (3 given)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 797077 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-26 20:04 UTC by John Florian
Modified: 2012-10-30 18:10 UTC (History)
8 users (show)

Fixed In Version: livecd-tools-16.11-1
Clone Of:
Environment:
Last Closed: 2012-10-30 18:10:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch that fixes the problem (424 bytes, patch)
2012-03-26 20:04 UTC, John Florian
no flags Details | Diff

Description John Florian 2012-03-26 20:04:05 UTC
Created attachment 572865 [details]
Patch that fixes the problem

Description of problem:
If the fsck after resize returns an error, imgcreate/fs.py raises another secondary exception while trying to raise the ResizeError exception.

Version-Release number of selected component (if applicable):
livecd-tools-16.10-1.fc16.x86_64
python-imgcreate-16.10-1.fc16.x86_64

How reproducible:
always (when there's a fsck error after the resize operation)

Steps to Reproduce:
1. Do whatever it takes to get fsck to return a non-zero result.
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/livecd-creator", line 210, in <module>
    sys.exit(main())
  File "/usr/bin/livecd-creator", line 200, in main
    creator.package()
  File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 744, in package
    self._stage_final_image()
  File "/usr/lib/python2.7/site-packages/imgcreate/live.py", line 330, in _stage_final_image
    self._resparse()
  File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 897, in _resparse
    return self.__instloop.resparse(size)
  File "/usr/lib/python2.7/site-packages/imgcreate/fs.py", line 526, in resparse
    minsize = self.__resize_to_minimal()
  File "/usr/lib/python2.7/site-packages/imgcreate/fs.py", line 521, in __resize_to_minimal
    resize2fs(self.disk.lofile, minimal = True, tmpdir = self.tmpdir)
  File "/usr/lib/python2.7/site-packages/imgcreate/fs.py", line 108, in resize2fs
    raise ResizeError("fsck after resize returned an error (%d)!", (ret,))
TypeError: __init__() takes exactly 2 arguments (3 given)

Expected results:
Only the ResizeError exception, not the TypeError exception too.

Additional info:
A patch that resolves the issue has been attached.

Comment 1 Mads Kiilerich 2012-04-10 14:17:03 UTC
--- fs.py	2012-04-10 16:15:41.849657773 +0200
+++ /usr/lib/python2.7/site-packages/imgcreate/fs.py	2012-04-10 16:16:09.339483153 +0200
@@ -105,7 +105,7 @@
 
     ret = e2fsck(fs)
     if ret != 0:
-        raise ResizeError("fsck after resize returned an error (%d)!", (ret,))
+        raise ResizeError("fsck after resize returned an error (%d)!" % (ret,))
 
     return 0

Comment 2 Fedora Update System 2012-04-10 16:34:55 UTC
livecd-tools-16.11-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/FEDORA-2012-3066/livecd-tools-16.11-1.fc16

Comment 3 Brian Lane 2012-04-12 23:26:58 UTC
*** Bug 797077 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2012-04-13 21:34:59 UTC
livecd-tools-16.11-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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