- # Get the config for this action
- action_config = config.get_action_config(opts, action)
- # Create a handler for this action
- handler = handlers.create_handler(action_ty, action_config)
-
- if handler:
- # Run the handler
- handler.run()
- handler.finish()
- # Silently skip invalid handlers, create_handler will have
- # logged an error
+ action_log = logging.getLogger(config_name)
+ action_log.info('Running')
+
+ try:
+ # Create a handler for this action
+ action = handlers.create_action(action_ty, logger=action_log)
+ # Let the handler load its configuration file
+ action.load_config(action_config)
+ # Run it
+ action.run(test=opts.test)
+ action.finish(test=opts.test)
+ # Ask the action if there where any failures
+ success = not action.failed
+ except Exception, e:
+ action_log.error('Unexpected exception: %s', e)
+ import traceback
+ log.debug(traceback.format_exc())
+ success = False
+
+ if success:
+ action_log.info('Succeeded')
+ else:
+ action_log.info('Failed')