#NEWLINE# def __init__( self , message = None , **kwargs ) : #NEWLINE# #INDENT# self . kwargs = kwargs #NEWLINE# if ( 'code' not in self . kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . kwargs [ 'code' ] = self . code #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# if ( not message ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# message = ( self . msg_fmt % kwargs ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# exc_info = sys . exc_info ( ) #NEWLINE# LOG . exception ( _LE ( 'Exception in string format operation' ) ) #NEWLINE# for ( name , value ) in six . iteritems ( kwargs ) : #NEWLINE# #INDENT# LOG . error ( ( '%s: %s' % ( name , value ) ) ) #NEWLINE# #UNINDENT# if CONF . fatal_exception_format_errors : #NEWLINE# #INDENT# six . reraise ( * exc_info ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# message = self . msg_fmt #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . message = message #NEWLINE# super ( NovaException , self ) . __init__ ( message )