[PATCH 2/2] Catch errors from blivet when parsing kickstart.

Anne Mulhern amulhern at redhat.com
Tue Sep 16 18:08:48 UTC 2014





----- Original Message -----
> From: "Anne Mulhern" <amulhern at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Tuesday, September 16, 2014 1:52:37 PM
> Subject: Re: [PATCH 2/2] Catch errors from blivet when parsing kickstart.
> 
> 
> 
> 
> 
> ----- Original Message -----
> > From: "David Lehman" <dlehman at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Tuesday, September 16, 2014 12:30:48 PM
> > Subject: [PATCH 2/2] Catch errors from blivet when parsing kickstart.
> > 
> > Resolves: rhbz#1072285
> > ---
> >  pyanaconda/kickstart.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > index 9103d25..4c90d4e 100644
> > --- a/pyanaconda/kickstart.py
> > +++ b/pyanaconda/kickstart.py
> > @@ -26,7 +26,7 @@ from blivet.devicelibs import swap as swap_lib
> >  from blivet.formats import getFormat
> >  from blivet.partitioning import doPartitioning
> >  from blivet.partitioning import growLVM
> > -from blivet.errors import PartitioningError
> > +from blivet.errors import PartitioningError, StorageError
> >  from blivet.size import Size
> >  from blivet import udev
> >  from blivet.platform import platform
> > @@ -1830,7 +1830,7 @@ def preScriptPass(f):
> >  
> >      try:
> >          ksparser.readKickstart(f)
> > -    except KickstartError as e:
> > +    except (KickstartError, StorageError, ValueError) as e:
> >          # We do not have an interface here yet, so we cannot use our error
> >          # handling callback.
> >          print(e)
> > --
> > 1.9.3
> > 
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> > 
> 
> There's an opportunity to reexamine few rethrows of
> ValueErrors and StorageErrors as KickstartErrors in
> Iscsi, LogVolData, PartitionData, RaidData classes.
> 
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Actually, I realized there is a problem here which is somewhat significant.
If Value- and Storage- Errors are caught and rethrown as KickstartErrors
the line number information is propagated, this way, it is not and the user
is not pointed at the line that failed.

- mulhern


More information about the anaconda-patches mailing list