Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Java (http://www.linux-archive.org/debian-java/)
-   -   filled in hasFreeDiskSpace (http://www.linux-archive.org/debian-java/523204-filled-hasfreediskspace.html)

Mark Hamzy 05-06-2011 07:57 PM

filled in hasFreeDiskSpace
 
This is for defect 683632. This was tested on the Fedora 15 beta.

---
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.
--
1.7.1

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

David Lehman 05-10-2011 06:32 PM

filled in hasFreeDiskSpace
 
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 01:13 PM.

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