config: Check action config filenames more strictly.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 13:13:44 +0000 (15:13 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 13:13:44 +0000 (15:13 +0200)
Previously, the filename was split at the first dot, now it can only
contain just one dot. Also fix the error message to actually include the
faulty filename.

src/lib/backupninja/action.py

index 3939c8d487e677968efae783cff753a3dec810ea..7c80148d9c24f15f86e1c49892449e81c62d7e2b 100644 (file)
@@ -52,9 +52,9 @@ def run_action(action, opts, global_config):
     """
     log.info('Running action "%s"', action)
     # Split the action filename
     """
     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
 
         return
     (action_name, action_ty) = parts