'Returns a function for all on_task_* events, that runs all the configured plugins.'

def __getattr__(self, item):

    for (phase, method) in plugin.phase_methods.items():
        if ((item == method) and (phase not in [u'accept', u'reject', u'fail'])):
            break
    else:
        raise AttributeError(item)
    def handle_phase(task, config):
        u'Function    that    runs    all    of    the    configured    plugins    which    act    on    the    current    phase.'
        results = []
        for item in config:
            for (plugin_name, plugin_config) in item.items():
                if (phase in plugin.get_phases_by_plugin(plugin_name)):
                    method = plugin.get_plugin_by_name(plugin_name).phase_handlers[phase]
                    log.debug((u'Running    plugin    %s' % plugin_name))
                    result = method(task, plugin_config)
                    if isinstance(result, list):
                        results.extend(result)
        return results
    return handle_phase
