[anaconda:rhel7/master 1/2] Move some statically detectable kickstart errors out of anaconda (#1117908)

mulhern amulhern at redhat.com
Wed Aug 20 16:38:29 UTC 2014


Related: rhbz#1117908

These errors have everything to do with the options in the file and nothing
to do with the situation in which they are supposed to be executed, so they
should be checked when the file is read.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 pyanaconda/kickstart.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 977d9a0..523c72d 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -822,14 +822,8 @@ class LogVolData(commands.logvol.F20_LogVolData):
             if tmp:
                 raise KickstartValueError(formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name))
 
-            # Size specification checks
-            if not self.percent:
-                if not self.size:
-                    raise KickstartValueError(formatErrorMsg(self.lineno, msg="Size required"))
-                elif not self.grow and self.size*1024 < vg.peSize:
-                    raise KickstartValueError(formatErrorMsg(self.lineno, msg="Logical volume size must be larger than the volume group physical extent size."))
-            elif self.percent <= 0 or self.percent > 100:
-                raise KickstartValueError(formatErrorMsg(self.lineno, msg="Percentage must be between 0 and 100"))
+            if not self.percent and self.size and not self.grow and self.size*1024 < vg.peSize:
+                raise KickstartValueError(formatErrorMsg(self.lineno, msg="Logical volume size must be larger than the volume group physical extent size."))
 
         # Now get a format to hold a lot of these extra values.
         fmt = getFormat(ty,
-- 
1.9.3



More information about the anaconda-patches mailing list