[anaconda][rhel7-branch/master][PATCH] Don't crash if escrow certificate is requested without network access (#1085265)

Anne Mulhern amulhern at redhat.com
Fri Sep 26 15:57:11 UTC 2014

----- Original Message -----
> From: "Chris Lumens" <clumens at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, September 26, 2014 11:39:34 AM
> Subject: Re: [anaconda][rhel7-branch/master][PATCH] Don't crash if escrow	certificate is requested without network
> access (#1085265)
> > There's nothing wrong with the value, it's the context, so KickstartError
> > is the most appropriate to raise.
> """
> It also exports several exception classes:
>     KickstartError - A generic exception class.
> """
> So, KicsktartError is really intended for things that don't fit anywhere
> else.  I see one use in pykickstart/commands/repo.py that really ought to
> be something else, and then there's a couple in pykickstart/parser.py
> that at least need to be audited.
> But in general, it's meant as a top-level exception class for everything
> to derive from.  It's also more meant to be caught than raised.  Think
> about "except Exception" instead of "raise Exception".
> - Chris
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches

Unfortunately, our only options are KSValueError, KSVersionError, KSParseError
and the situation of no network being available definitely does not match any of them.

Maybe a KSRuntimeError is needed?

In any case catching KickstartError in the two places I mentioned
will fix the bug and be correct as well, AFAICT.
Those places where KickstartError is raised can be
audited at leisure and replaced w/ a more appropriate subclass
whenever it becomes available.

- mulhern

More information about the anaconda-patches mailing list