[PATCH 4/4] Remove hasFreeDiskSpace and related code.

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

 



This function is needless complication. If you only check for free
regions greater or equal to 100MB people will be blocked from
creating new PReP or BIOS BOOT partitions even though they should
not be. OTOH if you only check for 1MB of free space that is of
nearly no informational value when creating a new LVM PV as
compared to having no information at all.
---
 pyanaconda/iw/partition_gui.py     |   15 +--------------
 pyanaconda/storage/partitioning.py |   24 ------------------------
 2 files changed, 1 insertions(+), 38 deletions(-)

diff --git a/pyanaconda/iw/partition_gui.py b/pyanaconda/iw/partition_gui.py
index a833bd5..c62d0a6 100644
--- a/pyanaconda/iw/partition_gui.py
+++ b/pyanaconda/iw/partition_gui.py
@@ -49,7 +49,6 @@ from pyanaconda.partIntfHelpers import *
 from pyanaconda.constants import *
 from partition_ui_helpers_gui import *
 from pyanaconda.storage.partitioning import doPartitioning
-from pyanaconda.storage.partitioning import hasFreeDiskSpace
 from pyanaconda.storage.devicelibs import lvm
 from pyanaconda.storage.devices import devicePathToName, PartitionDevice
 from pyanaconda.storage.devices import deviceNameToDiskByPath
@@ -1306,16 +1305,7 @@ class PartitionWindow(InstallWindow):
         # First we must decide what parts of the create_storage_dialog
         # we will activate.
 
-        # For the Partition checkboxes.
-        # If we see that there is free space in the "Hard Drive" list, then we
-        # must activate all the partition radio buttons (RAID partition,
-        # LVM partition and Standard partition).  We will have only one var to
-        # control all three activations (Since they all depend on the same
-        # thing)
-        activate_create_partition = False
-        free_part_available = hasFreeDiskSpace(self.storage)
-        if free_part_available:
-            activate_create_partition = True
+        activate_create_partition = True
 
         # We activate the create Volume Group radio button if there is a free
         # partition with a Physical Volume format.
@@ -1480,9 +1470,6 @@ class PartitionWindow(InstallWindow):
         whathave_lvm = P_("You currently have %d available PV free to use.\n",
                             "You currently have %d available PVs free to use.\n",
                             availpvs) % (availpvs, )
-        if free_part_available:
-            whathave_lvm = whathave_lvm + _("You currently have free space to "
-                    "create PVs.")
         lvminfo_message = "%s\n%s%s" % (whatis_lvm, whatneed_lvm, whathave_lvm)
         lvminfo_cb = lambda x : self.intf.messageWindow(_("About LVM"),
                                     lvminfo_message, custom_icon="information")
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 85d4c29..0c98f57 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -1866,30 +1866,6 @@ def growPartitions(disks, partitions, free):
                     device.partedPartition = newpart
 
 
-def hasFreeDiskSpace(storage, exclusiveDisks=None):
-    """Returns True if there is at least 100Mb of free usable space in any of
-       the disks.  False otherwise.
-
-    """
-
-    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.3.4

_______________________________________________
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