X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fbackupninja.git;a=blobdiff_plain;f=src%2Flib%2Fbackupninja%2Faction.py;h=3939c8d487e677968efae783cff753a3dec810ea;hp=1ebc737cfdd76c7b0c176f175659128fd87e7a32;hb=79e2eb7919193ff6d6bf5c6452aa531497590bd5;hpb=5687af1dbbe8647ac6f333e0480d44e31d1fa6f3 diff --git a/src/lib/backupninja/action.py b/src/lib/backupninja/action.py index 1ebc737..3939c8d 100644 --- a/src/lib/backupninja/action.py +++ b/src/lib/backupninja/action.py @@ -33,7 +33,13 @@ def run_all_actions(opts, global_config): opts are the parsed commandline options, global_config is the parsed global configuration. """ - actions = config.list_actions(opts) + log.info('Running all actions') + try: + actions = config.list_actions(opts) + except OSError, e: + log.critical('Unable to list actions: %s', e) + return + actions.sort() for action in actions: @@ -44,6 +50,7 @@ def run_action(action, opts, global_config): Run a single action. opts are the parsed commandline options, global_config is the parsed global configuration. """ + log.info('Running action "%s"', action) # Split the action filename parts = action.split('.', 2) if (len(parts) < 2): @@ -58,7 +65,7 @@ def run_action(action, opts, global_config): # Create a handler for this action handler = handlers.create_handler(action_ty, action_config) # Run it - handler.run() - handler.finish() + handler.run(test=opts.test) + handler.finish(test=opts.test) except Exception, e: log.error('Running action "%s" failed: %s', action, e)