Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux General Discussion (http://www.linux-archive.org/archlinux-general-discussion/)
-   -   Initialize Decimal for partition slices (#602376) (http://www.linux-archive.org/archlinux-general-discussion/383874-initialize-decimal-partition-slices-602376-a.html)

"Brian C. Lane" 06-09-2010 08:45 PM

Initialize Decimal for partition slices (#602376)
 
Some of the values passed to Decimal can be floats,
Decimal needs them as strings for the initializer.

Related: rhbz#599614
Resolves: rhbz#602376
---
iw/partition_gui.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 4c13a65..62121f2 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -376,10 +376,10 @@ class DiskStripeGraph(StripeGraph):
continue

# Create the start and length for the slice.
- xoffset = (Decimal(part.geometry.start)
- / Decimal(drive.partedDevice.length))
- xlength = (Decimal(part.geometry.length)
- / Decimal(drive.partedDevice.length))
+ xoffset = (Decimal(str(part.geometry.start))
+ / Decimal(str(drive.partedDevice.length)))
+ xlength = (Decimal(str(part.geometry.length))
+ / Decimal(str(drive.partedDevice.length)))

if part.type == parted.PARTITION_LOGICAL:
partstr = "%s
%.0f MB" % (part.path, float(part.getSize()))
@@ -487,7 +487,7 @@ class LVMStripeGraph(StripeGraph):

#xoffset = float(curr_offset) / float(vg.size)
xoffset = curr_offset
- xlength = Decimal(lv.size) / Decimal(vg.size)
+ xlength = Decimal(str(lv.size)) / Decimal(str(vg.size))

slice = Slice(stripe, lvstr, stype, xoffset, xlength,
dcCB = self.dcCB, cCB = self.cCB, sel_col = sel_col,
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 01:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.