[PATCH 4/5] Enforce format min/max size for fixed-size requests.

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

 



Resolves: rhbz#603188
---
 pyanaconda/storage/partitioning.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 9b49152..61f03ae 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -980,6 +980,20 @@ def allocatePartitions(storage, disks, partitions, freespace):
             if _part.req_grow:
                 current_free = None
 
+            problem = None
+            if _part.req_size > _part.format.maxSize:
+                problem = "large"
+            elif ((not _part.req_grow and
+                   _part.req_size < _part.format.minSize) or
+                  (_part.req_grow and _part.req_max_size and
+                   _part.req_max_size < _part.format.minSize)):
+                # format max/min size also enforced in growPartitions
+                problem = "small"
+
+            if problem:
+                raise PartitioningError("partition is too %s for %s formatting"
+                                        % (problem, _part.format.name))
+
             log.debug("checking freespace on %s" % _disk.name)
 
             new_part_type = getNextPartitionType(disklabel.partedDisk)
-- 
1.6.6.1

_______________________________________________
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