def _interpret_emr_bootstrap_stderr(fs, matches, partial=True):
 result = {}
 for match in matches:
  stderr_path = match['path']
  task_error = _parse_task_stderr(_cat_log(fs, stderr_path))
  if task_error:
   task_error = dict(task_error)
   task_error['path'] = stderr_path
   error = dict(action_num=match['action_num'], node_id=match['node_id'], task_error=task_error)
   result.setdefault('errors', [])
   result['errors'].append(error)
   if partial:
    result['partial'] = True
    break
 return result

def _interpret_emr_bootstrap_stderr ( fs , matches , partial = True ) : result = { } for match in matches : stderr_path = match [ 'path' ] task_error = _parse_task_stderr ( _cat_log ( fs , stderr_path ) ) if task_error : task_error = dict ( task_error ) task_error [ 'path' ] = stderr_path error = dict ( action_num = match [ 'action_num' ] , node_id = match [ 'node_id' ] , task_error = task_error ) result . setdefault ( 'errors' , [ ] ) result [ 'errors' ] . append ( error ) if partial : result [ 'partial' ] = True break return result
extract errors from bootstrap stderr .