[blivet] Convert parted getLength values to Size
Vratislav Podzimek
vpodzime at redhat.com
Thu Jan 16 08:17:01 UTC 2014
On Wed, 2014-01-15 at 20:39 -0500, David Shea wrote:
> ---
> blivet/devices.py | 2 +-
> blivet/partitioning.py | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/blivet/devices.py b/blivet/devices.py
> index fbcfbe9..9b546e3 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -1709,7 +1709,7 @@ class PartitionDevice(StorageDevice):
> pass
> else:
> if partition.type == parted.PARTITION_FREESPACE:
> - maxPartSize = self.size + partition.getLength(unit="B")
> + maxPartSize = self.size + Size(bytes=partition.getLength(unit="B"))
>
> return min(self.format.maxSize, maxPartSize)
>
> diff --git a/blivet/partitioning.py b/blivet/partitioning.py
> index e5da886..e3a36bb 100644
> --- a/blivet/partitioning.py
> +++ b/blivet/partitioning.py
> @@ -137,7 +137,7 @@ def _schedulePartitions(storage, disks):
>
> free = Size(bytes=all_free[0].getLength(unit="B"))
> if len(all_free) > 1:
> - free += int(all_free[1].getLength(unit="B"))
> + free += Size(bytes=all_free[1].getLength(unit="B"))
>
> # The boot disk must be set at this point. See if any platform-specific
> # stage1 device we might allocate already exists on the boot disk.
These all look good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list