Bug 807035 - ResizeError.__init__() takes exactly 2 arguments (3 given)
ResizeError.__init__() takes exactly 2 arguments (3 given)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: livecd-tools (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Brian Lane
Fedora Extras Quality Assurance
:
: 797077 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 16:04 EDT by John Florian
Modified: 2012-10-30 14:10 EDT (History)
8 users (show)

See Also:
Fixed In Version: livecd-tools-16.11-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-30 14:10:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description John Florian 2012-03-26 16:04:05 EDT
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 10:17:03 EDT
--- 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 12:34:55 EDT
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 19:26:58 EDT
*** Bug 797077 has been marked as a duplicate of this bug. ***
Comment 4 Fedora Update System 2012-04-13 17:34:59 EDT
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.