actions: Print a traceback on failed actions in debug mode.
[matthijs/projects/backupninja.git] / src / lib / backupninja / action.py
index 3939c8d487e677968efae783cff753a3dec810ea..de36c4ba713fb7a5198d5abdc9d0792fdbfe6427 100644 (file)
@@ -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
 
@@ -69,3 +69,5 @@ def run_action(action, opts, global_config):
         handler.finish(test=opts.test)
     except Exception, e:
         log.error('Running action "%s" failed: %s', action, e)
+        import traceback
+        log.debug(traceback.format_exc())