X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fbackupninja.git;a=blobdiff_plain;f=src%2Flib%2Fbackupninja%2Faction.py;h=1ebc737cfdd76c7b0c176f175659128fd87e7a32;hp=3f57a188f7b9b6a2f171bbb7f4a34442110b2a6b;hb=5687af1dbbe8647ac6f333e0480d44e31d1fa6f3;hpb=c9514724e6fad55405d92f3931056d5f69cfa4f4;ds=sidebyside diff --git a/src/lib/backupninja/action.py b/src/lib/backupninja/action.py index 3f57a18..1ebc737 100644 --- a/src/lib/backupninja/action.py +++ b/src/lib/backupninja/action.py @@ -21,6 +21,8 @@ """ Running backup actions """ +import logging as log + from backupninja import config from backupninja import handlers @@ -32,6 +34,7 @@ def run_all_actions(opts, global_config): global configuration. """ actions = config.list_actions(opts) + actions.sort() for action in actions: run_action(action, opts, global_config) @@ -50,12 +53,12 @@ def run_action(action, opts, global_config): # 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 + try: + # Create a handler for this action + handler = handlers.create_handler(action_ty, action_config) + # Run it handler.run() handler.finish() - # Silently skip invalid handlers, create_handler will have - # logged an error + except Exception, e: + log.error('Running action "%s" failed: %s', action, e)