[blivet:master 0/4] Catching Exception patches

Martin Kolman mkolman at redhat.com
Fri Apr 18 10:10:01 UTC 2014


On Thu, 2014-04-17 at 17:47 -0700, Brian C. Lane wrote:
> On Thu, Apr 17, 2014 at 04:18:48PM -0400, mulhern wrote:
> > The first contains a function for more thoroughly logging exceptions.
> > It may seem strange that I pass string format args as a list, but it was
> > not obvious that there was a better way to arrange the arguments.
> > 
> > The remaining three patches all suppress warnings but use the logging function
> > to log the exception information more completely. The exception logging
> > function can be extended to, e.g., log more complete information or raise 
> > selected exceptions as appropriate.
> > 
> > mulhern (4):
> >   Add a function that logs available exception info.
> >   Disable some W0703 warnings.
> >   Disable some W0703 warnings
> >   Log exception information and disable W0703 warning.
> > 
> >  blivet/__init__.py          | 58 +++++++++++++++++++++++++++------------------
> >  blivet/arch.py              |  7 ++++--
> >  blivet/deviceaction.py      |  8 ++++++-
> >  blivet/devicetree.py        | 12 ++++++----
> >  blivet/formats/disklabel.py | 17 ++++++++++++-
> >  blivet/formats/fs.py        | 15 ++++++++----
> >  blivet/iscsi.py             |  8 +++++--
> >  blivet/storage_log.py       | 28 ++++++++++++++++++++++
> >  8 files changed, 115 insertions(+), 38 deletions(-)
> > 
> > -- 
> > 1.8.3.1
> 
> These look good to me. The only question I have is why pass in
> sys.exc_info() every time instead of just calling it in the handler?
Yeah, sys.exc_info() seems to be thread-local so even if another
exception is raised in another thread between when the handler is called
and the handler code executed, exc_info() should still return only the
original exception.
> 




More information about the anaconda-patches mailing list