Account for space gained through clearpart and use actual payload
space requirement.
---
pyanaconda/ui/gui/spokes/storage.py | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index fe5f39f..47b00c0 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -47,6 +47,7 @@ from pyanaconda.ui.gui.categories.storage import StorageCategory
from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded
from pyanaconda.storage.size import Size
+from pyanaconda.storage.partitioning import shouldClear
from pyanaconda.product import productName
-def get_free_space_info(disks, devicetree):
+def get_free_space_info(disks, devicetree, clearPartType, clearPartDisks):
disk_free = 0
fs_free = 0
for disk in disks:
@@ -107,7 +108,9 @@ def get_free_space_info(disks, devicetree):
for partition in devicetree.getChildren(disk):
# only check actual filesystems since lvm &c require a bunch of
# operations to translate free filesystem space into free disk space
- if hasattr(partition.format, "free"):
+ if shouldClear(partition, clearPartType, clearPartDisks):
+ disk_free += partition.size
+ elif hasattr(partition.format, "free"):
fs_free += partition.format.free
print("disks %s have %d free, plus %s in filesystems"
@@ -115,7 +118,12 @@ def get_free_space_info(disks, devicetree):
return (disk_free, fs_free)
summary = (P_(("%d disk selected; %s capacity; %s free ..."),
@@ -542,8 +552,11 @@ class StorageSpoke(NormalSpoke):
def on_continue_clicked(self, button):
# show the installation options dialog
disks = [d for d in self.disks if d.name in self.selected_disks]
- (disk_free, fs_free) = get_free_space_info(disks, self.storage.devicetree)
- required_space = 12000 # TODO: find out where to get this
+ (disk_free, fs_free) = get_free_space_info(disks,
+ self.storage.devicetree,
+ self.clearPartType,
+ self.selected_disks)
+ required_space = self.payload.spaceRequired
if disk_free >= required_space:
dialog = InstallOptions1Dialog(self.data)
elif sum([d.size for d in disks]) >= required_space:
--
1.7.7.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list