[PATCH 5/8] Fix maxSize test when setting device target size.

David Lehman dlehman at redhat.com
Thu Feb 20 18:01:37 UTC 2014


maxSize can be 0, which means there is no max size.
---
 blivet/devices.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/devices.py b/blivet/devices.py
index 023e411..3ac000f 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -550,7 +550,7 @@ class StorageDevice(Device):
         if not isinstance(newsize, Size):
             raise ValueError("new size must of type Size")
 
-        if newsize > self.maxSize:
+        if self.maxSize and newsize > self.maxSize:
             log.error("requested size %s is larger than maximum %s",
                       newsize, self.maxSize)
             raise ValueError("size is larger than the maximum for this device")
@@ -820,7 +820,7 @@ class StorageDevice(Device):
         if not isinstance(newsize, Size):
             raise ValueError("new size must of type Size")
 
-        if newsize > self.maxSize:
+        if self.maxSize and newsize > self.maxSize:
             raise DeviceError("device cannot be larger than %s" %
                               (self.maxSize,), self.name)
         self._size = newsize
-- 
1.8.5.3



More information about the anaconda-patches mailing list