def add_instance_fault_from_exc(context, conductor, instance, fault, exc_info=None):
 code = 500
 message = fault.__class__.__name__
 if hasattr(fault, 'kwargs'):
  code = fault.kwargs.get('code', 500)
  message = fault.kwargs.get('value', message)
 details = unicode(fault)
 if (exc_info and (code == 500)):
  tb = exc_info[2]
  details += ('\n' + ''.join(traceback.format_tb(tb)))
 values = {'instance_uuid': instance['uuid'], 'code': code, 'message': unicode(message), 'details': unicode(details), 'host': CONF.host}
 conductor.instance_fault_create(context, values)

def add_instance_fault_from_exc ( context , conductor , instance , fault , exc_info = None ) : code = 500 message = fault . __class__ . __name__ if hasattr ( fault , 'kwargs' ) : code = fault . kwargs . get ( 'code' , 500 ) message = fault . kwargs . get ( 'value' , message ) details = unicode ( fault ) if ( exc_info and ( code == 500 ) ) : tb = exc_info [ 2 ] details += ( '\n' + '' . join ( traceback . format_tb ( tb ) ) ) values = { 'instance_uuid' : instance [ 'uuid' ] , 'code' : code , 'message' : unicode ( message ) , 'details' : unicode ( details ) , 'host' : CONF . host } conductor . instance_fault_create ( context , values )
adds the specified fault to the database .