From: Matthijs Kooijman Date: Thu, 10 Jun 2010 13:13:44 +0000 (+0200) Subject: config: Check action config filenames more strictly. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fbackupninja.git;a=commitdiff_plain;h=ac66ee385bda4a477e5501880ff945be6abc5f06;hp=7a6692ef5f50f18d92b53095ab09fb2f046bccbe 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. --- 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