'record the results of a task for a single host'

def _finish_task(self, status, result):

    task_uuid = result._task._uuid
    if hasattr(result, '_host'):
        host_uuid = result._host._uuid
        host_name = result._host.name
    else:
        host_uuid = 'include'
        host_name = 'include'
    task_data = self._task_data[task_uuid]
    if ((self._fail_on_change == 'true') and (status == 'ok') and result._result.get('changed', False)):
        status = 'failed'
    if ((status == 'failed') and ('EXPECTED    FAILURE' in task_data.name)):
        status = 'ok'
    task_data.add_host(HostData(host_uuid, host_name, status, result))
