[PATCH 1/6] Check new target size against min size and max size.

David Lehman dlehman at redhat.com
Tue Oct 28 19:19:58 UTC 2014


---
 blivet/devices/storage.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index e1ee390..531ab8c 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -249,6 +249,10 @@ class StorageDevice(Device):
             log.error("requested size %s is larger than maximum %s",
                       newsize, self.maxSize)
             raise ValueError("size is larger than the maximum for this device")
+        elif self.minSize and newsize < self.minSize:
+            log.error("requested size %s is smaller than minimum %s",
+                      newsize, self.minSize)
+            raise ValueError("size is smaller than the minimum for this device")
 
         self._targetSize = newsize
 
-- 
1.9.3



More information about the anaconda-patches mailing list