Esempio n. 1
0
 def handle_phase(task, config):
     """Function that runs all of the configured plugins which act on the current phase."""
     # Keep a list of all results, for input plugin combining
     results = []
     for item in config:
         for plugin_name, plugin_config in item.iteritems():
             if phase in get_phases_by_plugin(plugin_name):
                 method = get_plugin_by_name(plugin_name).phase_handlers[phase]
                 log.debug('Running plugin %s' % plugin_name)
                 result = method(task, plugin_config)
                 if isinstance(result, list):
                     results.extend(result)
     return results
Esempio n. 2
0
 def handle_phase(task, config):
     """Function that runs all of the configured plugins which act on the current phase."""
     # Keep a list of all results, for input plugin combining
     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]
                 logger.debug('Running plugin {}', plugin_name)
                 result = method(task, plugin_config)
                 if phase == 'input' and result:
                     results.append(result)
     return itertools.chain(*results)