def _format_failure(failure):
 result = failure['result']
 host = result._host.get_name()
 play = _get_play(result._task)
 if play:
  play = play.get_name()
 task = result._task.get_name()
 msg = result._result.get('msg', u'???')
 rows = ((u'Host', host), (u'Play', play), (u'Task', task), (u'Message', stringc(msg, C.COLOR_ERROR)))
 row_format = '{:10}{}'
 return [row_format.format((header + u':'), body) for (header, body) in rows]

def _format_failure ( failure ) : result = failure [ 'result' ] host = result . _host . get_name ( ) play = _get_play ( result . _task ) if play : play = play . get_name ( ) task = result . _task . get_name ( ) msg = result . _result . get ( 'msg' , u'???' ) rows = ( ( u'Host' , host ) , ( u'Play' , play ) , ( u'Task' , task ) , ( u'Message' , stringc ( msg , C . COLOR_ERROR ) ) ) row_format = '{:10}{}' return [ row_format . format ( ( header + u':' ) , body ) for ( header , body ) in rows ]
return a list of pretty-formatted lines describing a failure .