Re: [PATCH] filled in hasFreeDiskSpace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2011-05-06 at 14:57 -0500, Mark Hamzy wrote:
> This is for defect 683632.  This was tested on the Fedora 15 beta.

This looks fine to me. See docs/commit-log.txt in the git repo for
information about formatting your commit message for easy parsing,
specifically the part about putting (#bugnumber) at the end of the first
line.

Dave

> 
> ---
>  pyanaconda/storage/partitioning.py |   24 +++++++++++++++++-------
>  1 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
> index bddca32..5bd2acd 100644
> --- a/pyanaconda/storage/partitioning.py
> +++ b/pyanaconda/storage/partitioning.py
> @@ -1643,14 +1643,24 @@ def hasFreeDiskSpace(storage, exclusiveDisks=None):
>         the disks.  False otherwise.
>  
>      """
> -    # FIXME: This function needs to be implemented.  It is used, at least, by
> -    # iw/partition_gui.py.  It should be implemented after the new
> -    # doPartitioning code is commited for fedora 13.  Since it returns True
> -    # the user will always be able to access the create partition screen. If
> -    # no partition can be created, the user will go back to the previous
> -    # storage state after seeing a warning message.
> -    return True
>  
> +    hasFreeSpace = False
> +    disks = storage.partitioned
> +
> +    if exclusiveDisks:
> +        disks = [d for d in disks if d.name in exclusiveDisks]
> +
> +    for disk in disks:
> +        if storage.config.clearPartDisks and \
> +           (disk.name not in storage.config.clearPartDisks):
> +            continue
> +
> +        for part in disk.format.partedDisk.getFreeSpacePartitions():
> +            if part.getSize(unit="MB") >= 100:
> +                hasFreeSpace = True
> +                break
> +
> +    return hasFreeSpace
>  
>  def lvCompare(lv1, lv2):
>      """ More specifically defined lvs come first.


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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux