[PATCH] If there are errors processing the kickstart file early on, just print them.

Vratislav Podzimek vpodzime at redhat.com
Thu May 2 08:39:00 UTC 2013


On Wed, 2013-05-01 at 16:17 -0400, Chris Lumens wrote:
> We don't have an interface yet to use, so printing looks better than displaying
> a traceback.
> ---
>  pyanaconda/kickstart.py | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index 3ed6621..6442ca5 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -1462,7 +1462,7 @@ class AnacondaKSParser(KickstartParser):
>          self.registerSection(TracebackScriptSection(self.handler, dataObj=self.scriptClass))
>          self.registerSection(PackageSection(self.handler))
>          self.registerSection(AddonSection(self.handler))
> -        
> +
>  def preScriptPass(f):
>      # The first pass through kickstart file processing - look for %pre scripts
>      # and run them.  This must come in a separate pass in case a script
> @@ -1472,7 +1472,9 @@ def preScriptPass(f):
>      try:
>          ksparser.readKickstart(f)
>      except KickstartError as e:
> -        errorHandler.cb(KickstartError(), e)
> +        # We do not have an interface here yet, so we cannot use our error
> +        # handling callback.
> +        print e
>          sys.exit(1)
>  
>      # run %pre scripts
> @@ -1497,7 +1499,9 @@ def parseKickstart(f):
>      try:
>          ksparser.readKickstart(f)
>      except KickstartError as e:
> -        errorHandler.cb(KickstartError(), e)
> +        # We do not have an interface here yet, so we cannot use our error
> +        # handling callback.
> +        print e
>          sys.exit(1)
>  
>      return handler
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list