Bug 602376 - TypeError: Cannot convert float to Decimal. First convert the float to a string
TypeError: Cannot convert float to Decimal. First convert the float to a string
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda (Show other bugs)
6.0
i386 Linux
medium Severity medium
: rc
: ---
Assigned To: Brian Lane
Release Test Team
anaconda_trace_hash:e30b2738d9f6ab5d7...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-09 14:12 EDT by Brian Lane
Modified: 2010-11-10 14:47 EST (History)
2 users (show)

See Also:
Fixed In Version: anaconda-13.21.51-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 14:47:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Attached traceback automatically from anaconda. (737.77 KB, text/plain)
2010-06-09 14:12 EDT, Brian Lane
no flags Details

  None (edit)
Description Brian Lane 2010-06-09 14:12:36 EDT
The following was filed automatically by anaconda:
anaconda 13.21.48 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.6/decimal.py", line 653, in __new__
    "First convert the float to a string")
  File "/tmp/updates/partition_gui.py", line 490, in _createStripe
    xlength = Decimal(lv.size) / Decimal(vg.size)
  File "/tmp/updates/partition_gui.py", line 299, in setDisplayed
    self.stripe = self._createStripe(obj)
  File "/tmp/updates/partition_gui.py", line 471, in __init__
    self.setDisplayed(vg)
  File "/tmp/updates/partition_gui.py", line 1259, in treeSelectCB
    dcCB = self.barviewActivateCB)
TypeError: Cannot convert float to Decimal.  First convert the float to a string
Comment 1 Brian Lane 2010-06-09 14:12:41 EDT
Created attachment 422637 [details]
Attached traceback automatically from anaconda.
Comment 2 Brian Lane 2010-06-09 14:15:58 EDT
Looks like there are cases where lv.size and/or vg.size are not integers. Need to convert to a string when passing to Decimal() like so: "%0.4f" % lv.size
Comment 4 RHEL Product and Program Management 2010-06-09 14:33:08 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 5 Brian Lane 2010-06-09 16:49:04 EDT
I have a fix ready for this - https://www.redhat.com/archives/anaconda-devel-list/2010-June/msg00125.html
Comment 6 Brian Lane 2010-06-09 16:50:29 EDT
To be clear: I introduced this with my fix for green partition stripes for bug #599614
Comment 8 Alexander Todorov 2010-07-06 05:22:21 EDT
(In reply to comment #2)
> Looks like there are cases where lv.size and/or vg.size are not integers. Need
> to convert to a string when passing to Decimal() like so: "%0.4f" % lv.size    

Hi Brian,
how can I end up in a situation where those sizes are floats and not integers?
Comment 9 Brian Lane 2010-07-08 11:42:53 EDT
IIRC this was triggered by pre-existing partitions that would trigger bug 599614.
Comment 10 Alexander Todorov 2010-08-10 11:07:48 EDT
In bug 608172 I've tested haveing 3 partitions, /boot, swap and / and on the second install I've chosen to shrink the current system and created default LVM layout. 

There was no traceback. Given that bug 599614 is VERIFIED and the patch from comment #5 is already included I'm moving it to VERIFIED.
Comment 11 releng-rhel@redhat.com 2010-11-10 14:47:31 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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