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

[PATCH] If --size=0 --grow is given, set the size to 1 (#497186, #497389).



---
 kickstart.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 6c4a060..06d804d 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -392,8 +392,8 @@ class LogVol(commands.logvol.F9_LogVol):
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name)
 
             # Size specification checks
-            if lvd.percent == 0:
-                if lvd.size == 0:
+            if not lvd.percent:
+                if not lvd.size:
                     raise KickstartValueError, formatErrorMsg(self.lineno, msg="Size required")
                 elif not lvd.grow and lvd.size*1024 < vg.peSize:
                     raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume size must be larger than the volume group physical extent size.")
@@ -616,7 +616,7 @@ class Partition(commands.partition.F9_Partition):
             return pd
 
         # Size specification checks.
-        if pd.size is None and pd.onPart == "":
+        if not pd.size and not pd.onPart:
             raise KickstartValueError, formatErrorMsg(self.lineno, msg="Partition requires a size specification")
 
         # Now get a format to hold a lot of these extra values.
@@ -642,9 +642,12 @@ class Partition(commands.partition.F9_Partition):
             kwargs["disks"] = [disk]
 
         kwargs["grow"] = pd.grow
-        kwargs["size"] = pd.size
         kwargs["maxsize"] = pd.maxSizeMB
         kwargs["primary"] = pd.primOnly
+        if not pd.size:
+            kwargs["size"] = 1
+        else:
+            kwargs["size"] = pd.size
 
         # If we were given a pre-existing partition to create a filesystem on,
         # we need to verify it exists and then schedule a new format action to
-- 
1.6.1.3


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