From ac66ee385bda4a477e5501880ff945be6abc5f06 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 10 Jun 2010 15:13:44 +0200 Subject: [PATCH 1/1] config: Check action config filenames more strictly. 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/backupninja/action.py b/src/lib/backupninja/action.py index 3939c8d..7c80148 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 -- 2.30.2