def error_out(resource, reason=None, status='error'):
 reason = _clean_reason(reason)
 try:
  LOG.debug('Setting %(object_type)s %(object_id)s to error due to: %(reason)s', {'object_type': resource.obj_name(), 'object_id': resource.id, 'reason': reason})
  resource.status = status
  resource.save()
 except Exception:
  LOG.exception(_LE('Failed setting %(object_type)s %(object_id)s to  %(status)s status.'), {'object_type': resource.obj_name(), 'object_id': resource.id, 'status': status})

def error_out ( resource , reason = None , status = 'error' ) : reason = _clean_reason ( reason ) try : LOG . debug ( 'Setting %(object_type)s %(object_id)s to error due to: %(reason)s' , { 'object_type' : resource . obj_name ( ) , 'object_id' : resource . id , 'reason' : reason } ) resource . status = status resource . save ( ) except Exception : LOG . exception ( _LE ( 'Failed setting %(object_type)s %(object_id)s to  %(status)s status.' ) , { 'object_type' : resource . obj_name ( ) , 'object_id' : resource . id , 'status' : status } )
sets status to error for any persistent ovo .