FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-09-2010, 08:45 PM
"Brian C. Lane"
 
Default 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
 

Thread Tools




All times are GMT. The time now is 05:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org