X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fbackupninja.git;a=blobdiff_plain;f=src%2Flib%2Fbackupninja%2Faction.py;h=de36c4ba713fb7a5198d5abdc9d0792fdbfe6427;hp=e110d933d2aa521cbc7b334f3ad2bb072c28758f;hb=1f0203fd6f3b7833a619f4206c118056c4b469d9;hpb=52ce78d1bf9e1344b9fc27cae81c158580579b34 diff --git a/src/lib/backupninja/action.py b/src/lib/backupninja/action.py index e110d93..de36c4b 100644 --- a/src/lib/backupninja/action.py +++ b/src/lib/backupninja/action.py @@ -52,9 +52,9 @@ def run_action(action, opts, global_config): """ log.info('Running action "%s"', action) # Split the action filename - parts = action.split('.', 2) - if (len(parts) < 2): - log.error('Invalid action filename: "%s". Should be in the form name.type, where type is a valid handler.') + parts = action.split('.') + if (len(parts) != 2): + log.error('Invalid action filename: "%s". Should be in the form name.type, where type is a valid handler.' % action) return (action_name, action_ty) = parts @@ -65,7 +65,9 @@ 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) + import traceback + log.debug(traceback.format_exc())